Count still running when i re-enter the car, please need help :( - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Count still running when i re-enter the car, please need help :( (
/showthread.php?tid=638513)
Count still running when i re-enter the car, please need help :( -
AngeloBrand98 - 01.08.2017
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
Re: Count still running when i re-enter the car, please need help :( -
Jefff - 01.08.2017
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)
?
Re: Count still running when i re-enter the car, please need help :( -
AngeloBrand98 - 02.08.2017
thanks mate, its working fine


