i need one little help..
#1

Hello guys, i need one little help in zombie apocalypse the time is running to slowly like 250(after 8 seconds)245(again after 8 seconds) 240...
help me to make this as like this 250(after 1seconds) 249(again after 1 second)248.....

here what i found in gammeode:

Код:
function OnMapUpdate()
{
	time -= 1;

	new str[64];
	format(str,sizeof(str),"%d",time);
	TextDrawSetString(TimeLeft,str);

	if(time <= 0) TextDrawSetString(TimeLeft," ..."),KillTimer(mapvar),KillTimer(balvar),SetTimer("ShowCheckpoint",MAX_SHOW_CP_TIME,false);
	return 1;
}
---------------------------------------------------------------------------------------

Код:
function OnMapBalance()
{
	if(playerOnline >= 2)
	{
		if(GetTeamPlayersAlive(TEAM_HUMAN) == 0)
		{
			KillTimer(balvar);
			KillTimer(mapvar);
			TextDrawSetString(TimeLeft,"~r~Zombies win");
			SetTimer("EndMap",4000,false); // Cannot use MAX_END_TIME Because of MAX_END_TIME is set to 1 minute not 4 seconds *NOTE TO ME*
			foreach(Player,i)
			{
				if(team[i] == TEAM_ZOMBIE)
				{
					pInfo[i][pXP] += 30;
					GivePlayerXP(i,30);
				}
			}
		}
	}
	return 1;
}
---------------------------------------------------------------------------------------

Код:
	TimeLeft = TextDrawCreate(22.000000, 251.000000, "250");
	TextDrawBackgroundColor(TimeLeft, 255);
	TextDrawFont(TimeLeft, 3);
	TextDrawLetterSize(TimeLeft, 1.770000, 3.499999);
	TextDrawColor(TimeLeft, 16777215);
	TextDrawSetOutline(TimeLeft, 0);
	TextDrawSetProportional(TimeLeft, 1);
	TextDrawSetShadow(TimeLeft, 1);
---------------------------------------------------------------------------------------
Reply
#2

What's the interval of OnMapUpdate?
Reply
#3

what do you mean?
Reply
#4

I mean that SetTimer uses as parameter the interval.

pawn Код:
SetTimer(funcname[], interval, repeating);
So if you want it to be called every second instead of 8, you should use 1000 as interval (in milliseconds - it's 1 second).

pawn Код:
SetTimer("OnMapUpdate", 1000, true);
Reply
#5

can you make code of it?, and give it? in [code] {/code]
Reply
#6

Quote:
Originally Posted by BlackBomb
Посмотреть сообщение
can you make code of it?, and give it? in [code] {/code]
I already did. Look my above post, it says the correct way of setting the timer to 1 second. Replace it with your own one.
Reply
#7

i cant find that can you tell me full in or someone else can help me?
Reply
#8

Quote:
Originally Posted by BlackBomb
Посмотреть сообщение
i cant find that can you tell me full in or someone else can help me?
No, I cannot. I'm able to help you with the information you've given only.

Just press Ctrl + F and type: OnMapUpdate
If it's not in the first result, click on 'Find Next' button until you find a line about SetTimer.
Reply
#9

i cant find
SetTimer(funcname[], interval, repeating);
or
SetTimer("OnMapUpdate", 1000, true);
on gamemode :/
Reply
#10

Because they do not exist. I told you to search for "OnMapUpdate" only (without the quotes "" of course).

pawn Код:
SetTimer(funcname[], interval, repeating);
was an example of the parameters of the SetTimer.

pawn Код:
SetTimer("OnMapUpdate", 1000, true);
is the correct one which calls OnMapUpdate every second. You'll need to find where you set the timer about OnMapUpdate in your script and replace it with the above code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)