07.07.2015, 03:34
Utilize sscanf:
https://sampforum.blast.hk/showthread.php?tid=570927
Como utilizar strcmp e sscanf (substituir o strtok):
http://forum.sa-mp.com/showpost.php?...postcount=1141
Como utilizar o sscanf:
https://sampforum.blast.hk/showthread.php?tid=277842
Exemplo:
https://sampforum.blast.hk/showthread.php?tid=570927
Como utilizar strcmp e sscanf (substituir o strtok):
http://forum.sa-mp.com/showpost.php?...postcount=1141
Como utilizar o sscanf:
https://sampforum.blast.hk/showthread.php?tid=277842
Exemplo:
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[50 char], params[100 char];
unformat(cmdtext, "s[50]S( )[100]",cmd,params);
if(!strcmp(cmd, "/setlevel", true))
{
new id, level;
if(sscanf(params, "ud", id, level))
return SendClientMessage(playerid, 0xAA0000, "Uso: /setlevel [id] [level]");
SetPlayerScore(id, level);
return 1;
}
return 0;
}