help, count - 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: help, count (
/showthread.php?tid=359858)
help, count -
jaksimaksi - 15.07.2012
pawn Код:
forward Start(bool:redo);
public Start()
{
for(new i; i < MAX_PLAYERS; i++)
{
StopCounting--;
new string[256];
format(string,256,"~w~%d",StopCounting);
return GameTextForAll(string,1200,3);
if(StopCounting <= 0)
{
KillTimer(timer);
gaz = 0;
TogglePlayerControllable(i,1);
}
else
{
PlayerPlaySound(i,1056,0.0,0.0,0.0);
SetTimer("Start",1000,0);
SetTimer("gaz",1000,0);
gaz = 13;
}
}
return 1;
}
//----------
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
StopCounting = 3;
timer = SetTimerEx("Start", 0, 1, "d", playerid);
return 1;
}
return 0;
}
Why does my count showing nonsenses? He runs very fast and goes up to -1500
Re: help, count -
Universal - 15.07.2012
Why is your timer time set to 0?
pawn Код:
SetTimerEx("Start", 0, 1, "d", playerid);
And also why are you specifying a playerid, when you dont use it in your Start callback.
Your callback forward differs from the declaration:
pawn Код:
forward Start(bool:redo);
public Start()
Re: help, count -
[MM]RoXoR[FS] - 15.07.2012
Why are you returning Gametext. It will not allow further code to be implemented
pawn Код:
forward Start(playerid);
public Start()
{
for(new i; i < MAX_PLAYERS; i++)
{
StopCounting--;
new string[256];
format(string,256,"~w~%d",StopCounting);
GameTextForAll(string,1200,3);
if(StopCounting <= 0)
{
KillTimer(timer);
gaz = 0;
TogglePlayerControllable(i,1);
}
else
{
PlayerPlaySound(i,1056,0.0,0.0,0.0);
SetTimer("Start",1000,0);
SetTimer("gaz",1000,0);
gaz = 13;
}
}
return 1;
}
//----------
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
StopCounting = 3;
timer = SetTimerEx("Start", 1000, true, "d", playerid);
return 1;
}
return 0;
}
Try This ^^
Re: help, count -
jaksimaksi - 15.07.2012
Still not working, couting goes fast up to -1500
Re: help, count -
jaksimaksi - 15.07.2012
I want to make timer which activates in 10 seconds for example and after 10 seconds counting starts from 5 to 1, then players gets unfeezed