[HELP] Adding REASON
#1

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?
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)