Please Help-Protect The Prime Minister
#1

Can somebody tell me how to make a code that automatically ejects the Prime Minister from planes and Helicopters
Reply
#2

You need to give more detail. How do we know what the Prime Minister is defined as in your script? stuff like that we need or we cannot help you.
Reply
#3

You need to edit the 'CARIDHERE' and 'GTEAM HERE' Items items in the 'pawn' code.

pawn Код:
#include <vstream>
pawn Код:
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;
}
Reply
#4

Quote:
Originally Posted by dr.pepper
Посмотреть сообщение
You need to edit the 'CARIDHERE' and 'GTEAM HERE' Items items in the 'pawn' code.

pawn Код:
#include <vstream>
pawn Код:
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;
}
Thank toy very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)