GetPlayerName Help (Need It Quick Plese) - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerName Help (Need It Quick Plese) (
/showthread.php?tid=228855)
GetPlayerName Help (Need It Quick Plese) -
Alex_Obando - 20.02.2011
Hello, Im alex, I need you guys to help me with the GetPlayerName (%s) I have this script that is a bot, So when I type /banbot it'll say [Name Of Admin (%s)] Has Banned Jeremy (Reason: Becoming noob)
Code:
Код:
if (strcmp(cmdtext, "/banbot", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,0xff0000ff, "----------------------------------");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Banning the bot simulation successful, If the bot still talking unloadhim with the rcon.");
SendClientMessageToAll(COLOR_RED,"Administrator has banned Jeremy (Reason: TEST)");
SendClientMessageToAll(COLOR_GREY, "Jeremy has left the server (Kicked).");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"You are not [AU] Member");
return 1;
}
}
return 0;
}
PLESE SEND ME MY CODE WITH THIS (GETPLAYERNAME ADDED "%s")
Re: GetPlayerName Help (Need It Quick Plese) -
xRyder - 20.02.2011
This is basic, if you don't understand how to get players name you should really go and read SA-MP Wiki or something...
pawn Код:
if(strcmp(cmdtext,"/banbot",true)==0)
{
if(IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str),"Administrator %s has banned Jeremy (Reason: TEST)", name);
SendClientMessage(playerid,0xff0000ff, "----------------------------------");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Banning the bot simulation successful, If the bot still talking unloadhim with the rcon.");
SendClientMessageToAll(COLOR_RED,str);
SendClientMessageToAll(COLOR_GREY, "Jeremy has left the server (Kicked).");
return 1;
}
else return SendClientMessage(playerid,COLOR_YELLOW,"You are not [AU] Member");
}
Respuesta: GetPlayerName Help (Need It Quick Plese) -
Alex_Obando - 20.02.2011
Thanks Bro