02.05.2011, 19:20
Can somebody tell me how to make a code that automatically ejects the Prime Minister from planes and Helicopters
#include <vstream>
public OnPlayerStateChange(playerid, newstate, oldstate)
{
tAxI_OnPlayerStateChange(playerid,newstate,oldstate);
new carid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_PASSENGER && gTeam[playerid] == GTEAM HERE)
{
RemovePlayerFromVehicle(playerid);
}
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && gTeam[playerid] == GTEAM HERE)
{
if(carid == CARIDHERE)
{
SendClientMessage(playerid,0xAA3333AA,"This class cannot fly planes and has removed you.");
RemovePlayerFromVehicle(playerid);
}
else
{
}
}
return 1;
}
You need to edit the 'CARIDHERE' and 'GTEAM HERE' Items items in the 'pawn' code.
pawn Код:
pawn Код:
|