21.03.2009, 18:22
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) // This function checks if the state of a player is changing.
{
if(newstate == PLAYER_STATE_DRIVER)
{
new numero = GetPlayerVehicleID(playerid);
if(numero == Oiltanker)
{
if(gTeam[playerid] == TEAM_DEFENDERS)
{
SendClientMessage(playerid,0xFF0000AA, "You traitor, don't steal your own oil!");
RemovePlayerFromVehicle(playerid);
}
else if(gTeam[playerid] == TEAM_ATTACKERS)
{
SetPlayerCheckpoint(playerid, -740.419067, -118.292442, 67.074729, 5.0);
SendClientMessage(playerid, 0x33AA33AA, "You have stolen the oiltanker! Attach the trailer and don't lose your oil!!");
GameTextForAll("~g~Somebody is stealing the oiltanker!", 5000,3);
//SendClientMessageToAll(0xFF0000AA, "<Somebody is stealing the oil!>");
}
}
}//this closeing brace was missing, it was places further down in the wrong place.
else if(newstate == PLAYER_STATE_ONFOOT)
{
DisablePlayerCheckpoint(playerid);
SetVehicleParamsForPlayer(Oiltanker,playerid,1,0);
}
return 1;
}