SA-MP Forums Archive
Timers stops working - 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: Timers stops working (/showthread.php?tid=288625)



Timers stops working - cruising - 08.10.2011

Hello!

i have a timer for auto repair pickup, it works a couple of times and then it stop works, you can pick it up but your vehicle doesn't get repaired.
And i also found a mine script by "Studio FS(Games and Apec)" it counts down from 10 to 0 to activate the mines, if you walk near it, it explode. But also that one stops working after a while, it counts to 0..but no explode when you comes near it.

What can cause these timers to braking down?
If you need to see my pickups codes, just tell me.


Re: Timers stops working - nilanjay - 08.10.2011

Can you show the coding?


Re: Timers stops working - cruising - 08.10.2011

Here it is for the repair pickups.

Code:
pawn Код:
forward pickup();
    SetTimer("pickup",5000,true);

public pickup()
{
    newplayer = CreatePickup(1240,14,405.8782,2460.9792,17.2118,-1);
    airwolves = CreatePickup(1240,14,1619.4607,1337.4252,10.8095,-1);
    bluefoxes = CreatePickup(1240,14,1874.7584,-2288.3972,14.2586,-1);
    thunderbirds = CreatePickup(1240,14,-1372.7068,-214.9956,14.1484,-1);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == newplayer)
    {
        if(GetPlayerTeam(playerid) == 0)
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
            return 1;}
        }
    else if(pickupid == airwolves)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
            return 1;}
        }
    else if(pickupid == bluefoxes)
    {
        if(GetPlayerTeam(playerid) == 2)
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
            return 1;}
        }
    else if(pickupid == thunderbirds)
    {
        if(GetPlayerTeam(playerid) == 3)
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
            return 1;}
        }
    return 1;
}