06.04.2013, 12:14
Quote:
Hey! I need a team car system.. Have searched on ****** but no one work :/
Classes: gPlayerClass[playerid] = TRUCKER_CLASS; gPlayerClass[playerid] = FARMER_CLASS; Can someone make so when player if trucker or something and gonna enter a farmer vehicle he be set out from the car and get a message like : You can't enter a farmer vehicle |
pawn Код:
new
gClassVehicles[ MAX_JOB_CLASSES ][ MAX_CLASS_VEHICLES ]
;
Then you can add vehicles like this:
pawn Код:
gClassVehicles[ TRUCKER_CLASS ][ 0 ] = AddStaticVehicle( ... );
gClassVehicles[ TRUCKER_CLASS ][ 1 ] = AddStaticVehicle( ... );
gClassVehicles[ TRUCKER_CLASS ][ 2 ] = AddStaticVehicle( ... );
gClassVehicles[ FARMER_CLASS ][ 0 ] = AddStaticVehicle( ... );
gClassVehicles[ FARMER_CLASS ][ 1 ] = AddStaticVehicle( ... );
gClassVehicles[ FARMER_CLASS ][ 2 ] = AddStaticVehicle( ... );
pawn Код:
// Assuming you're using OnPlayerEnterVehicle:
for( new i = 0; i < sizeof( gClassVehicles[] ); i ++ )
{
if( vehicleid == gClassVehicles[ FARMER_CLASS ][ i ] && gPlayerClass[ playerid ] != FARMER_CLASS )
{
// If the above is true, the player isn't a farmer, but *he is entering a farmer-only vehicle
RemovePlayerFromVehicle( playerid );
}
else if( vehicleid == gClassVehicles[ TRUCKER_CLASS ][ i ] && gPlayerClass[ playerid ] != TRUCKER_CLASS )
{
// If the above is true, the player isn't a trucker, but *he is entering a trucker-only vehicle
RemovePlayerFromVehicle( playerid );
}
}