SA-MP Forums Archive
Name of the player - 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: Name of the player (/showthread.php?tid=106772)



Name of the player - Angelo94 - 05.11.2009

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/hunter", true) == 0)
{
SendClientMessageToAll(COLOR_SILVER, "Someone has gone to Hunter Battlefield.");
SetPlayerPos(playerid,8120.1440,-1640.9419,1902.4609);
return 1;
}



I want to make appear the name of the player instead of "Someone", what should i do?


Re: Name of the player - Lajko1 - 05.11.2009

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/hunter", true) == 0)
  {
  new playername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, playername, MAX_PLAYER_NAME);

  format(string, sizeof(string), "%s[%d] Has Joined (your zone)",playername,playerid);
  SendClientMessage(playerid,0x33CCFFAA,string);

  SetPlayerPos(playerid,8120.1440,-1640.9419,1902.4609);
   return 1;
  }
i think it should be like this but i am not 100% cuz i dont test ^^


Re: Name of the player - Correlli - 05.11.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/hunter", true) == 0)
  {
    new
        string[64];
    GetPlayerName(playerid, string, MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s has gone to Hunter Battlefield.", string);
    SendClientMessageToAll(COLOR_SILVER, string);
    SetPlayerPos(playerid, 8120.1440, -1640.9419, 1902.4609);
    return 1;
  }
  return 0;
}



Re: Name of the player - Angelo94 - 05.11.2009

thank you very much!!!!