17.11.2011, 10:15
Hey.. I'm continue work on driving test and I got into a problem...
I want to make that if the player leave the car so the car respawn and he lose the driving test..
I did this but its not working...
public OnPlayerStateChange(playerid, newstate, oldstate)
Any suggestions? btw.. I tried to put it onplayerexitvehicle but still didnt work..
I want to make that if the player leave the car so the car respawn and he lose the driving test..
I did this but its not working...
public OnPlayerStateChange(playerid, newstate, oldstate)
pawn Код:
if(IsADMV(GetPlayerVehicleID(playerid)))
{
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT || oldstate == PLAYER_STATE_PASSENGER && newstate == PLAYER_STATE_ONFOOT)
{
new veh;
veh = GetPlayerVehicleID(playerid);
DrivingTest[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(veh);
SendClientMessage(playerid,COLOR_RED,"STATUS: You left your car, FAIL!");
return 1;
}
}