17.01.2016, 20:26
https://sampwiki.blast.hk/wiki/Sscanf
https://sampwiki.blast.hk/wiki/Sscanf_code
The 'u' parameter is used for finding a name / id which is connected to the server, and it is returning 65535 (INVALID_PLAYER_ID) because the input did not match any connected name / identities.
Change 'u' to 's[128]', and change reason, to reason[128],
Reason being, 's' indicates a string, and it seems like you want to use a formatted one as the variable is titled 'reason'.
You should definitely read the wiki before proceeding with scripting.
Alternatively, you could forget sscanf for now, and just use 'params'.
Example:
https://sampwiki.blast.hk/wiki/Sscanf_code
The 'u' parameter is used for finding a name / id which is connected to the server, and it is returning 65535 (INVALID_PLAYER_ID) because the input did not match any connected name / identities.
Change 'u' to 's[128]', and change reason, to reason[128],
Reason being, 's' indicates a string, and it seems like you want to use a formatted one as the variable is titled 'reason'.
You should definitely read the wiki before proceeding with scripting.
Alternatively, you could forget sscanf for now, and just use 'params'.
Example:
Код:
CMD:leavejob(playerid, params[]) { static string[128]; if(isnull(params)) return SendClientMessage(...); format(string, sizeof(string), "%s has left their job. Reason: %s"...., params); // rest of code. }