Count still running when i re-enter the car, please need help :(
#1

HI, I have made an trucking job system, its acctually 99% working but got something bug,,, when i enter a truck to do trucking missions, it will be showing where i need to go (to Checkpoint)... and if player get out from the truck then will be warned like "you got 30 second to enter the car of failed mission". And the problem is when i re-enter the car, the time still count and when it 0 misson failed . idk what is the problem. can you guys help me to fix the script ? iam really glad to say thank you

Script :

Код:
forward pvTimeDown(playerid);
public pvTimeDown(playerid)
{
	new vid = GetPVarInt(playerid, "LastVehicle");
	pvtime[playerid] --;
	if (pvtime[playerid]== 0)
	{
		KillTimer(pvtimer[playerid]);
		if(IsInTMis[playerid]==1 && IsInPMis[playerid]==0){
			DestroyVehicle(vid);
		}
		else {
			SetVehicleToRespawn(vid);
		}
		pvtime[playerid] = 0;
  		IsInTMis[playerid]=0;
		IsInPMis[playerid]=0;
		SetVehicleParamsForPlayer(vid, playerid, 0, 0);
		SendClientMessage(playerid, COLOR_RED, "You have failed to complete the mission.");
		DisablePlayerRaceCheckpoint(playerid);
		gPlayerRaceCheckpointStatus[playerid] = 0;
		return 1;
	}
 	if(pvtime[playerid] > 0 && IsInTMis[playerid]==1)
		{
     	new string[256];
	    SetVehicleParamsForPlayer(vid, playerid, 1, 0);
  		format(string, 50, "~n~~n~~n~~n~~w~-You Got %d secs-", pvtime[playerid]);
		GameTextForPlayer(playerid, string, 1500, 3);
		}
	return 1;
}
Thanks and hopefully someone can help me

Note : Sorry for my bad english xD
Reply
#2

pawn Код:
if(IsPlayerInVehicle(playerid, vid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    KillTimer(pvtimer[playerid]);
    pvtime[playerid] = 0;
        return 1;
}
between

pawn Код:
pvtime[playerid] --;
// here
if (pvtime[playerid]== 0)
?
Reply
#3

thanks mate, its working fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)