SA-MP Forums Archive
GetPlayerName Not Working - 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 Not Working (/showthread.php?tid=320975)



GetPlayerName Not Working - Mario™ - 25.02.2012

Gello Guyz i made a Teleport Message Like when Plaer goes to /lv
It says player has Went To /lv

But its not Working The way i want It To Work

This is my Whole Teleport Command

Код:
    if(!strcmp(cmdtext, "/ls", true)){
		if(!IsPlayerInAnyVehicle(playerid)){
		SetPlayerPos(playerid, 1509.6604, -1665.7976, 14.0468);
		SetPlayerFacingAngle(playerid, 272.9591);
		SetPlayerInterior(playerid, 0);
		SetPlayerVirtualWorld(playerid, 0);
		new name[MAX_PLAYER_NAME], string[256];
    	GetPlayerName(playerid, name, sizeof(name));
    	format(string, sizeof(string), "{8B8F8F}(TELE){00FFFB}% {8B8F8F}Has Went To Las Santos {00FFFB}/ls.", name);
    	SendClientMessageToAll(0xC4C4C4FF, string);
		}
		else{
		new veh = GetPlayerVehicleID(playerid);
		SetVehiclePos(veh, 1509.6604, -1665.7976, 14.0468);
		SetVehicleZAngle(veh, 272.9591);
		LinkVehicleToInterior(veh, 0);
		SetVehicleVirtualWorld(veh, 0);
		PutPlayerInVehicle(playerid, veh, 0);
	 	new name[MAX_PLAYER_NAME], string[256];
    	GetPlayerName(playerid, name, sizeof(name));
    	format(string, sizeof(string), "{8B8F8F}(TELE){00FFFB}% {8B8F8F}Has Went To Las Santos {00FFFB}/ls.", name);
    	SendClientMessageToAll(0xC4C4C4FF, string);
		}
		return 1;
}
The Problem is That it doesnt Gets The players Name it Just Only Says

Код:
(TELE: Has went To Las Santos
It doesnt Says That (TELE)Mario was Went To Las Santos


Re: GetPlayerName Not Working - emokidx - 25.02.2012

pawn Код:
format(string, sizeof(string), "{8B8F8F}(TELE){00FFFB}%s {8B8F8F}Has Went To Las Santos {00FFFB}/ls.", name);
you forgot the "s" after "%"


AW: GetPlayerName Not Working - dalkgamler - 25.02.2012

you have do write %s or not?


Re: GetPlayerName Not Working - [ABK]Antonio - 25.02.2012

{8B8F8F}(TELE){00FFFB}% {8B8F8F}Has Went To Las Santos {00FFFB}/ls.

should be

{8B8F8F}(TELE){00FFFB}%s {8B8F8F}Has Went To Las Santos {00FFFB}/ls.


%s = string


Re: GetPlayerName Not Working - Mario™ - 25.02.2012

Thnx Guyz Its Working