Faction Vehicles
#9

Works like a charm! Thanks again for the help.

If anyone can think at a solution with
pawn Код:
OnPlayerStateChange
I would appreciate it.

Till now, I have:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if( newstate == 2 )
    {
        new VehicleID = GetPlayerVehicleID ( playerid );
   
        if( IsLSPDVeh( VehicleID ) )
        {
            if( GetPVarInt( playerid, "Faction" ) == 1 ) { }// LSPD Faction
            else
            {
                RemovePlayerFromVehicle( playerid );
                SendClientMessage( playerid, -1, "You don`t have the keys for this car." );
            }
            return 1;
        }
        if( IsFBIVeh( VehicleID ) )
        {
            if( GetPVarInt( playerid, "Faction" ) == 2 ) { } // FBI Faction
            else
            {
                RemovePlayerFromVehicle( playerid );
                SendClientMessage( playerid, -1, "You don`t have the keys for this car." );
            }
            return 1;
        }
    }
    return 1;
}
And the IsLSPDVeh and ISFBIVeh:
pawn Код:
stock IsLSPDVeh( VehicleID )
{
    if ( ( VehicleID == LSPDCar[ 0 ] || LSPDCar[ 1 ] || LSPDCar[ 2 ] || LSPDCar[ 3 ] || LSPDCar[ 4 ] || LSPDCar[ 5 ] || LSPDCar[ 6 ] || LSPDCar[ 7 ] || LSPDCar[ 8 ] || LSPDCar[ 9 ] || LSPDCar[ 10 ] || LSPDCar[ 11 ] ) )
        return true;
    else return false;
}
stock IsFBIVeh( VehicleID )
{
    if ( ( VehicleID == FBICar[ 0 ] || FBICar[ 1 ] || FBICar[ 2 ] || FBICar[ 3 ] || FBICar[ 4 ] || FBICar[ 5 ] || FBICar[ 6 ] ) )
        return true;
    else return false;
}
Reply


Messages In This Thread
Faction Vehicles[Problem solved] - by antonio112 - 12.03.2011, 13:03
Re: Faction Vehicles - by iMonk3y - 12.03.2011, 13:19
Re: Faction Vehicles - by antonio112 - 12.03.2011, 13:25
Re: Faction Vehicles - by iMonk3y - 12.03.2011, 13:27
Re: Faction Vehicles - by antonio112 - 12.03.2011, 13:32
Re: Faction Vehicles - by iMonk3y - 12.03.2011, 13:37
Re: Faction Vehicles - by antonio112 - 12.03.2011, 13:43
Re: Faction Vehicles - by iMonk3y - 12.03.2011, 13:52
Re: Faction Vehicles - by antonio112 - 12.03.2011, 14:33

Forum Jump:


Users browsing this thread: 1 Guest(s)