Thread: sscanf issue
View Single Post
Old 27/08/2017, 09:55 AM   #2
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: sscanf issue

Solve:

Code:
if(sscanf(params, "iii", var1, var2, var3))
Example:

Code:
cmd:test(playerid, params[])
{
new id, money, n[24], str[256];
if(sscanf(params, "ui", id, money)) return SendClientMessage(playerid, -1, "/test <playerid/player name> <money>");
{
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "* Wrong ID or name.");
GivePlayerMoney(id, money);
GetPlayerName(playerid, n, 24);
format(str, 256, "%s given you $%d.", n, money);
SendClientMessage(id, -1, str);
}
return 1;
}
skuller12 is offline   Reply With Quote