SA-MP Forums Archive
[HELP] Adding REASON - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Adding REASON (/showthread.php?tid=77511)



[HELP] Adding REASON - Hot - 11.05.2009

pawn Код:
if(strcmp(cmdtext, "/911", true)==0)
    {
  new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(string, 256, "%s needs police help!", name);
    SendClientMessageToAll(0xFF00FFAA, string);
    return 1;
}
How can I add [Reason] to it?


Re: [HELP] Adding REASON - Weirdosport - 11.05.2009

You'd need to use either strtok or sscanf, I personally recommend sscanf. You can use the "z" function, meaning optional string, or the s function meaning that they have to use a string.

Search for "fast commands" on the wiki or look up dcmd/sscanf.