06.07.2014, 08:30
(
Последний раз редактировалось CyberX; 06.07.2014 в 14:40.
)
I will try it and if it will work , I will edit this Post and say it!!
But Thanks
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!!
But Thanks
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if ( newstate == PLAYER_STATE_DRIVER )
{
if(AccInfo[playerid][pVip] < 7)
{
if ( GetVehicleModel( GetPlayerVehicleID ( playerid ) ) == 447 )
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid , red, "You need to be VIP level 7 to drive this car!");
}
}
if(AccInfo[playerid][pVip] > 7)
{
if ( GetVehicleModel( GetPlayerVehicleID ( 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 ( GetVehicleModel( GetPlayerVehicleID ( playerid ) ) == 447 ) {
lastDriveTime[playerid] = gettime();
}
}
I'm very n00b with this Restrictions and SetTimer commands lines!!
You can see the image down there!!