Need some more help
#1

I want to make it so if someone does not have 10 score/exp they wont be able to go into a vehicle. Can anyone help?
Reply
#2

OnPlayerStateChange()
{
new pScore;

pScore = GetPlayerScore(playerid);

if(newstate==PLAYER_STATE_DRIVER && pScore < 10)
{
RemovePlayerFromVehicle(playerid);
}
}
Reply
#3

Can i make it a particular vehicle?
Reply
#4

If you mean a specific modelid:
pawn Код:
// OnPlayerStateChange:
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 411 && GetPlayerScore( playerid ) < 10 )
// Change the 411 to any valid modelid you want. 411 -> infernus
{
    RemovePlayerFromVehicle( playerid );
}
If you need a specific vehicleid (for a vehicle you've created and you know its vehicleid:
pawn Код:
// Let's say somewhere you've created a vehicle:
// it should be global:
// Specific_Veh = CreateVehicle( .. ); OR AddStaticVehicle( .. ); OR AddStaticVehicleEx( .. );

// OnPlayerStateChange:
if( newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID( playerid ) == Specific_Veh && GetPlayerScore( playerid ) < 10 )
{
    RemovePlayerFromVehicle( playerid );
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)