Drive a car with Limit
#3

I will try it and if it will work , I will edit this Post and say it!!
But Thanks

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
if ( 
newstate == PLAYER_STATE_DRIVER )
    {
        if(
AccInfo[playerid][pVip] < 7)
        {
            if ( 
GetVehicleModelGetPlayerVehicleID playerid ) ) == 447 )
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playerid red"You need to be VIP level 7 to drive this car!");
            }
        }
        if(
AccInfo[playerid][pVip] > 7)
        {
           if ( 
GetVehicleModelGetPlayerVehicleID playerid ) ) == 447 )
        {
        
// Check last drive time. We have to check if lastDriveTime is equal to 0, too, because it will be if the player has joined and hasn't driven the car yet.
        
new timeSinceLastDrive gettime() - lastDriveTime[playerid];
        if(
timeSinceLastDrive < (5*60) || lastDriveTime[playerid] == 0) {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playerid red"You need to wait 5 minutes before drive this car again!");
        }
 }
 }
 }
// When the player has exited the vehicle, update their lastDriveTime
else if(oldstate == PLAYER_STATE_DRIVER) {
        if ( 
GetVehicleModelGetPlayerVehicleID playerid ) ) == 447 ) {
                
lastDriveTime[playerid] = gettime();
        }

I do that but now when i use for the first time command /vheli and put me in that car, game removes me from the car and Show Message "You need to wait 5 minutes before drive this car again!"
I'm very n00b with this Restrictions and SetTimer commands lines!!
You can see the image down there!!
Reply


Messages In This Thread
Drive a car with Limit - by CyberX - 05.07.2014, 19:37
Re: Drive a car with Limit - by ev0lution - 05.07.2014, 21:33
Re: Drive a car with Limit - by CyberX - 06.07.2014, 08:30
Re: Drive a car with Limit - by ev0lution - 06.07.2014, 17:50
Re: Drive a car with Limit - by CyberX - 07.07.2014, 07:49

Forum Jump:


Users browsing this thread: 1 Guest(s)