timers
#1

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
Reply
#2

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);
Reply
#3

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
Reply
#4

Show me all of the code where you used the timer
Reply
#5

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.
Reply
#6

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

I forward it and it compiled!

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

Check out https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#9

I did i tried it but i still have no idea
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)