Bad code, help me
#4

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:

Код:
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.
}
Reply


Messages In This Thread
Bad code, help me - by PaskaV - 17.01.2016, 17:56
Re: Bad code, help me - by Pottus - 17.01.2016, 18:06
Re: Bad code, help me - by PaskaV - 17.01.2016, 18:18
Respuesta: Re: Bad code, help me - by IzadorO - 17.01.2016, 20:26

Forum Jump:


Users browsing this thread: 1 Guest(s)