Autofix Problem on specific car - 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: Autofix Problem on specific car (
/showthread.php?tid=291617)
Autofix Problem on specific car -
Kostas' - 20.10.2011
I have a chasecar, I have cancel speedboost/jump/flip and to finish it, I need to cancel the autofix while someone is driving the chasecar. Also, I want to cancel the teleport, but I have no idea how.
Here is the Autofix on OnFilterScriptInit()
pawn Код:
SetTimer("AutoFix", 1000, true);
And this.
pawn Код:
forward AutoFix(playerid);
public AutoFix(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
//Code here
}
return 1;
}
Should I use this but I don't know how to cancel it.
pawn Код:
for(new i=0; i<MAX_VEHICLES; i++)
{
if(i == ccar)
{
SetVehicleNumberPlate(i, "ChaseMe");
SetVehicleToRespawn(i);
}
}
Moreover, there is a fail, that i noticed few days ago. I can teleport with the chasecar. How to make it to SendClientMessage that "You cannot teleport while you are on Chasecar!"
Re: Autofix Problem on specific car -
=WoR=Varth - 20.10.2011
Make a boolean to check IsVehicleChaseCar.
Re: Autofix Problem on specific car -
spd_sahil - 21.10.2011
your autofix is in a timer right ?? so you can something like when
OnPlayerEntervehicle
if vehicle == chasecar
then Killtimer
onplayerexitvehicle
if vehicle == chasecar
SetTimer("AutoFix", 1000, true);
Re: Autofix Problem on specific car -
System64 - 21.10.2011
so basicly create variable, in that chase car set it n 0 and when he finish it set on 1, also in OnGameModeinit or in OnPlayerConnect set it on 1 and in timer check if a variable is 1