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(str, sizeof(str),"%s has used command /giveweapon on %d.", ReturnPlayerName(playerid), playerid);
SendWarningToAdmins(COLOR_AMSG, str);
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(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(targetplayer, pName2, MAX_PLAYER_NAME);
format(str, sizeof(str),"%s has used command /giveweapon on %s.", pName, pName2);
SendWarningToAdmins(COLOR_AMSG, str);
return 1;