How to Fix That ?
#1

guys how i can fix my gametext ?

ok here is the code

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new vehicleid;

	if(newstate == PLAYER_STATE_DRIVER)
	{
		vehicleid = GetPlayerVehicleID(playerid);

		if(gTeam[playerid] == TEAM_TERORIST && vehicleid == OBJECTIVE_VEHICLE_TERORIST)
		{ // It's the objective vehicle
		  GameTextForAll("~w~PLAYER %s (%d) IS DRIVING THE ~b~SOLIDER'S BULLET ~w~BACK ON ~r~TERORIST'S SPAWN, ~w~DESTROY HIM SOLIDERS !", 6000, 3);
		  gObjectiveGreenPlayer = playerid;
		}

		if(gTeam[playerid] == TEAM_SOLIDER && vehicleid == OBJECTIVE_VEHICLE_SOLIDER)
		{ // It's the objective vehicle
		  GameTextForAll("~w~PLAYER %s (%d) IS DRIVING THE ~r~TERORIST'S BULLET ~w~BACK ON ~b~SOLIDER'S SPAWN, ~w~DESTROY HIM TERORISTS !", 6000, 3);
		  gObjectiveBluePlayer = playerid;
		}
	}
	else if(newstate == PLAYER_STATE_ONFOOT)
	{
		if(playerid == gObjectiveGreenPlayer) {
		  gObjectiveGreenPlayer = (-1);
		  SetPlayerToTeamColor(playerid);
		}

		if(playerid == gObjectiveBluePlayer) {
		  gObjectiveBluePlayer = (-1);
		  SetPlayerToTeamColor(playerid);
		}
	}

  return 1;
}
i want when player enter to the bullet at terorist or soliders it write :

Example for Soliders:

Код:
GameTextForAll("~w~PLAYER %s (%d) IS DRIVING THE ~r~TERORIST'S BULLET ~w~BACK ON ~b~SOLIDER'S SPAWN, ~w~DESTROY HIM TERORISTS !", 6000, 3);
i give this ''%s (%d)'' to show player name and his ID but it wont ^^

here is the picture of my problem :

/imageshack/i/samp457.png/

so i want when player enter the Enemy Vehicle it Write: ''Player (players name and ID) ... bla bla bla''

not : ''Player %s (%d) ... bla bla bla''

So thanks for any help
Reply
#2

Use format
Код:
new str[128],nick[24];
GetPlayerName(playerid,nick,24);
format(str,128,"~w~PLAYER %s (%d) IS DRIVING THE ~r~TERORIST'S BULLET ~w~BACK ON ~b~SOLIDER'S SPAWN, ~w~DESTROY HIM TERORISTS !",nick,playerid);
GameTextForAll(str, 6000, 3);
Reply
#3

uh thank you man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)