GetPlayerName Not Working
#1

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
Reply
#2

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

you have do write %s or not?
Reply
#4

{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
Reply
#5

Thnx Guyz Its Working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)