sscanf issue
#1

hi.
i have the issue with a crack command.
code
Code:
new var1,var2,var3
if(sscanf(params)"iii",var1,var2,var3)
{
      SendClientMessage(playerid,red,"syntax wrong"):
}
else {
// it entered here
}
i am not getting any error but it always show wrongsyntax and var1,var2,var3 is numbers
anything wrong ??
thnx in advance
Reply
#2

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;
}
Reply
#3

it was not helpful
stil cantvmake ut work
Reply
#4

you have "#include <sscanf2>" ?
Reply
#5

yes it works with one var1 but does not work with var2 and var1
Reply
#6

Quote:
Originally Posted by bugmenotlol
View Post
hi.
i have the issue with a crack command.
code
Code:
new var1,var2,var3
if(sscanf(params)"iii",var1,var2,var3)
{
      SendClientMessage(playerid,red,"syntax wrong"):
}
else {
// it entered here
}
i am not getting any error but it always show wrongsyntax and var1,var2,var3 is numbers
anything wrong ??
thnx in advance
You should try something like that:
PHP Code:
if(sscanf(params"iii"var1var2var3))
    return 
SendClientMessage(playerid,red," wrong syntax"):
// other code 
Reply
#7

show me your command complete
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)