SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=589280)



Help - Thoma - 17.09.2015

Ok so i have a message to admin command thing but i need a little help:


PHP Code:
    new str[100];
    
format(strsizeof(str),"%s has used command /giveweapon on %d."ReturnPlayerName(playerid), playerid);
    
SendWarningToAdmins(COLOR_AMSGstr);
    return 
1
But it returns my playerid and not who i used the command on


Re: Help - saffierr - 17.09.2015

Why %d, just use %s.
and define it on new

PHP Code:
new str[100], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
GetPlayerName(targetplayerpName2MAX_PLAYER_NAME);
format(strsizeof(str),"%s has used command /giveweapon on %s."pNamepName2);
SendWarningToAdmins(COLOR_AMSGstr);
return 
1