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



GetPlayerName Help - Saleem - 18.07.2013

when i teleport to aa no player name showing


Код:
    if(strcmp(cmdtext,"/aa",true)==0)
    			{
				new msg[128];
    			if(IsPlayerInAnyVehicle(playerid)) {
    			new Float:X;
				new Float:Y;
				new Float:Z;
				new VehicleID;
				GetPlayerPos(playerid, X, Y, Z);
				VehicleID = GetPlayerVehicleID(playerid);
				SetVehiclePos(VehicleID, 401.6887,2448.4048,16.2053);
			 	}
				else {
				new Float:X;
				new Float:Y;
				new Float:Z;
				GetPlayerPos(playerid, X, Y, Z);
				GetPlayerName(playerid,msg,MAX_PLAYER_NAME);
    			format(msg, sizeof(msg), "[/Teleports]: %s Has Teleport To old airport : {D66F62}[/aa]", msg,playerid);
    			SetPlayerPos(playerid,406.3605, 2450.7273, 17.0000);
    			SendClientMessageToAll(COLOR_GREY,msg);
    			new SCMLText[256];
  			    format(SCMLText,sizeof(SCMLText),"~b~~h~%s(~w~%i~b~~h~) ~>~~>~~>~ ~w~(/aa)",msg,playerid);
    			TextDrawSetString(Tele0, SCMLText);
    			TextDrawShowForAll(Tele0);
				SetTimer("hideinfo",5000,false);
    			}
    		return 1;
          }



Re: GetPlayerName Help - Black Wolf - 18.07.2013

pawn Код:
format(SCMLText,sizeof(SCMLText),"~b~~h~%s(~w~%i~b~~h~) ~>~~>~~>~ ~w~(/aa)", PlayerName(playerid), msg,playerid);
and if you get undefined symbol PlayerName

paste this at your gamemode end
pawn Код:
stock PlayerName(playerid)
{
       new pName[24];
      GetPlayerName(playerid, pName, 24);
      return pName;
}



Re: GetPlayerName Help - Saleem - 18.07.2013

Quote:
Originally Posted by Black Wolf
Посмотреть сообщение
pawn Код:
format(SCMLText,sizeof(SCMLText),"~b~~h~%s(~w~%i~b~~h~) ~>~~>~~>~ ~w~(/aa)", PlayerName(playerid), msg,playerid);
and if you get undefined symbol PlayerName

paste this at your gamemode end
pawn Код:
stock PlayerName(playerid)
{
       new pName[24];
      GetPlayerName(playerid, pName, 24);
      return pName;
}
name is showing now but now i got id problem Showing 91 id for all players :/


Re: GetPlayerName Help - Kirollos - 18.07.2013

pawn Код:
format(SCMLText,sizeof(SCMLText),"~b~~h~%s(~w~%i~b~~h~) ~>~~>~~>~ ~w~(/aa)", PlayerName(playerid),playerid);