SA-MP Forums Archive
Question, - 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)
+--- Thread: Question, (/showthread.php?tid=294389)



Question, - ImprezBart - 01.11.2011

When i test the command it will say Player Not connected.
I don't know what i did wrong

PHP код:
CMD:acceptreport(playeridparams[])
{
    new 
pIDsendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
    if(
PlayerInfo[playerid][pAdmin] < 1) return SCM(playeridCOLOR_LIGHTRED,"[C-RP]: {FFFFFF}You are not authorized to use this");
    if(
sscanf(params,"u"pID)) return SCM(playeridCOLOR_LIGHTRED,"[C-RP]: {FFFFFF}/acceptreport [playerid]");
    if(!
IsPlayerConnected(pID)) return SCM(playeridCOLOR_LIGHTRED,"[C-RP]: {FFFFFF}Player not connected");
    else
    {
        if(
PlayerReport[pID] == 1)
        {
            
PlayerReport[pID] = 0;
             
GetPlayerName(playeridsendernamesizeof(sendername));
            
GetPlayerName(pIDnamesizeof(name));
            
format(stringsizeof(string), "[C-RP Admin]: {FFFFFF}%s has just accepted the report of [ID:%d]%s."sendernamepIDname);
            
ABroadCast(COLOR_LIGHTREDstring1);
            
format(stringsizeof(string), "[C-RP Admin]: {FFFFFF}%s has accepted your report and will assist you shortly."playeridsendername);
            
SendClientMessage(pIDCOLOR_LIGHTREDstring);
        }
        else return 
SCM(playeridCOLOR_LIGHTRED,"[C-RP]: {FFFFFF}That player didn't send a report!");
    }
    return 
1;




Re: Question, - Wesley221 - 01.11.2011

If you are using 0.3d server package, the 'u' parameter in sscanf isnt working YET. Use the parameter 'i' or 'd' instead.


Re: Question, - ImprezBart - 01.11.2011

Ahh, thanks.


Re: Question, - seanny - 01.11.2011

Dont use 0.3d, It aint stable (YET)


Re: Question, - i514x - 01.11.2011

It's for scripting so he can use it, I use it too.


Re: Question, - Zonoya - 01.11.2011

same as user above i use 0.3d