SA-MP Forums Archive
timers - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: timers (/showthread.php?tid=157290)



timers - ToPhrESH - 06.07.2010

Ugh, yes, I'm making a gangwar. I need help with timers. I keep having trouble with using the timers and making the gangzone flash.

I did something like this its a rough outline:
[pawno]
public OnPlayerEnterCheckpoint
(IsPlayerInArea)
{
SetTimer(Zone, 1, 12000,); //outline again i forgot the other parts of it
}

public Zone()
{
GangZoneFlashForAll(playerid, GetPlayerColor(playerid));
}
[/pawn]
So im having trouble for when the 2 miutes are up and it stops flashing and you have won the war and capture it. But when i do enter the area it just goes straight to where i put if you capture u get money, any help


Re: timers - Matthias_ - 06.07.2010

pawn Код:
SetTimer(Zone, 1, 12000,);
That's wrong in so many ways. First off all, your function needs to be forwarded :forward Zone();

Second of all, check the parameters of SetTimer: SetTimer(funcname[], interval, repeating)

pawn Код:
SetTimer(Zone, 1, 12000,); // You have a , at the end
SetTimer("Zone", 1, 12000); // Function name needs "" around them.
SetTimer("Zone", 12000, 1); // You switched interval and repeating around.
So the correct code is:

pawn Код:
forward Zone();
SetTimer("Zone", 12000, 1);



Re: timers - ToPhrESH - 06.07.2010

Yes of course man i know all that. As I said it was a rough outline. I know all about that. It's just making the timer to where the gangzone flashes for 2 minutes and you have to stay in for 2 minutes but if someone kills u it stops and u lose. the timer doesnt seem to work


Re: timers - Matthias_ - 06.07.2010

Show me all of the code where you used the timer


Re: timers - ToPhrESH - 06.07.2010

Hmm this is a point in life i should have sent my .pwn file to my email. Arg

Well for now I can't. I am on my laptop and my monitor is sitting in my bedroom getting its virus scan and updates done i can't get on for now :P
Man this sucks i cant remember i think i may have done something like this
pawn Код:
public Zone(playerid, flashcolor)
{
(IsPlayerInArea) //can't remember but i put something there
GangZoneFlashForAll(zone1, GetPlayerColor(playerid), flashcolor)
}
Can't remember the other. I'll try to get it tommorow. But like I said the timer isn't working. But I said I don't know how to get the gangzonetostopflashforall for when a player dies and it stops.


Re: timers - Matthias_ - 06.07.2010

Either way, that wouldn't have compiled. You're using parameters in a function where you didn't define any.


Re: timers - ToPhrESH - 06.07.2010

I forward it and it compiled!

Can you help with timers maybe? SetTimer to where my zone flashes for whoever is attacking it?


Re: timers - Matthias_ - 06.07.2010

Check out https://sampwiki.blast.hk/wiki/SetTimerEx


Re: timers - ToPhrESH - 06.07.2010

I did i tried it but i still have no idea