SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 02/05/2011, 07:20 PM   #1
msvu
Little Clucker
 
Join Date: Mar 2011
Posts: 35
Reputation: 0
Default Please Help-Protect The Prime Minister

Can somebody tell me how to make a code that automatically ejects the Prime Minister from planes and Helicopters
msvu is offline  
Old 02/05/2011, 08:47 PM   #2
Vero
Big Clucker
 
Vero's Avatar
 
Join Date: Jan 2011
Location: Scotland
Posts: 110
Reputation: 10
Default Re: Please Help-Protect The Prime Minister

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.
Vero is offline  
Old 02/05/2011, 10:28 PM   #3
dr.pepper
Huge Clucker
 
dr.pepper's Avatar
 
Join Date: Jul 2009
Posts: 309
Reputation: 38
Default Re: Please Help-Protect The Prime Minister

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

pawn Code:
#include <vstream>

pawn Code:
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;
}
dr.pepper is offline  
Old 03/05/2011, 03:08 PM   #4
msvu
Little Clucker
 
Join Date: Mar 2011
Posts: 35
Reputation: 0
Default Re: Please Help-Protect The Prime Minister

Quote:
Originally Posted by dr.pepper View Post
You need to edit the 'CARIDHERE' and 'GTEAM HERE' Items items in the 'pawn' code.

pawn Code:
#include <vstream>

pawn Code:
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
msvu is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help! Who has Protect the Prime Minister GM CHN-fei General 3 14/11/2008 08:20 AM


All times are GMT. The time now is 05:03 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.