Timers
#1

What would be an example of a timer that would run something (ex. NewTimer) every 2 minutes in the server

I was thinking in OnGameModeInit put SetTimerEx("NewTimer".....etc...... but im not sure that will work
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

An example?

say you got the function..
Код:
public Bacon()
you want it to go off every two minutes?
Код:
OnGameModeInIt()
SetTimer("Bacon",120000,1);
defining a timer, SetTimer("name",Interval(milliseconds),repeating);

Simple?
Reply
#4

Quote:
Originally Posted by [N
BL!nk ]
An example?

say you got the function..
Код:
public Bacon()
you want it to go off every two minutes?
Код:
OnGameModeInIt()
SetTimer("Bacon",120000,1);
defining a timer, SetTimer("name",Interval(milliseconds),repeating);

Simple?
Sorry for saying this after recently posting another post, but you forgot to Forward it

Forward Bacon();
Reply
#5

Quote:
Originally Posted by Anthony_Brassi
Quote:
Originally Posted by [N
BL!nk ]
An example?

say you got the function..
Код:
public Bacon()
you want it to go off every two minutes?
Код:
OnGameModeInIt()
SetTimer("Bacon",120000,1);
defining a timer, SetTimer("name",Interval(milliseconds),repeating);

Simple?
Sorry for saying this after recently posting another post, but you forgot to Forward it

Forward Bacon();
Thats how I thought to do it, just making sure I wasnt wrong. Thanks guys
Reply
#6

Quote:
Originally Posted by Antonio (dominationrp.netii.net)
Quote:
Originally Posted by Anthony_Brassi
Quote:
Originally Posted by [N
BL!nk ]
An example?

say you got the function..
Код:
public Bacon()
you want it to go off every two minutes?
Код:
OnGameModeInIt()
SetTimer("Bacon",120000,1);
defining a timer, SetTimer("name",Interval(milliseconds),repeating);

Simple?
Sorry for saying this after recently posting another post, but you forgot to Forward it

Forward Bacon();
Thats how I thought to do it, just making sure I wasnt wrong. Thanks guys
No Problem, Good luck
Reply
#7

Quote:
Originally Posted by Anthony_Brassi
Quote:
Originally Posted by [N
BL!nk ]
An example?

say you got the function..
Код:
public Bacon()
you want it to go off every two minutes?
Код:
OnGameModeInIt()
SetTimer("Bacon",120000,1);
I know, i was demonstrating, btw Good luck! Remember not to make to many timers!
defining a timer, SetTimer("name",Interval(milliseconds),repeating);

Simple?
Sorry for saying this after recently posting another post, but you forgot to Forward it

Forward Bacon();
Reply
#8

Код HTML:
CMD:sonnenbrille(playerid,params[])
{
	new randShit = random(sizeof(RandomBacon));
	if(GetPVarInt(playerid, "Bacon") == 0)
	{
		SendClientMessage(playerid,0x21DD00FF, RandomBacon[randShit]);
		SetPVarInt(playerid, "Bacon", 1);
		ApplyAnimation(playerid,"RIOT","RIOT_shout",2.0,0,0,0,0,0);
		TextDrawBoxColor(SunGlasses, 0x00000040);
		TextDrawShowForPlayer(playerid, SunGlasses);
		SetPlayerAttachedObject(playerid,0,19022,2,0.1,0.04,0.0,60.0,85.0,25.0,1.0,1.0,1.0);
	}
	else
	{
		SetPVarInt(playerid, "Bacon", 0);
		TextDrawHideForPlayer(playerid, SunGlasses);
		ApplyAnimation(playerid,"RIOT","RIOT_shout",2.0,0,0,0,0,0);
		RemovePlayerAttachedObject(playerid, 0);
  		SendClientMessage(playerid,FARBE_WEISS,"Du hast deine Sonnenbrille abgesetzt.");
    }
    return 1;
}
CMD:helligkeit(playerid,params[])
{
	if(GetPVarInt(playerid, "Bacon") == 0) return SendClientMessage(playerid,FARBE_ROT,"Du hast keine Sonnenbrille aufgesetzt! (/sonnenbrille)");
	ShowPlayerDialog(playerid,668,DIALOG_STYLE_INPUT,"Sonnenbrillen-System","Stell deine Helligkeit ein:\nhell\nnormal\ndunkel\nam dunkelsten","Aufsetzen","Abbrechen");
 	return 1;
}
may this cause anything? because i don't have "Bacon" defined anywhere .
Reply
#9

It's player variable. https://sampwiki.blast.hk/wiki/GetPVarInt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)