whats The problem with this? D:? - 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: whats The problem with this? D:? (
/showthread.php?tid=176076)
whats The problem with this? D:? -
traxrex - 12.09.2010
Код:
if (strcmp(cmd, "/restart", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 10)
{
SendClientMessage(playerid, COLOR_GREY, " You are not an lvl 10 Admin !");
return 1;
}
OOCOff(COLOR_OOC,"[OOC] Icecream-Bot: Server Is Restarting, Remember to /putgun and Stay Connected.");
CountDownTimer = SetTimer("CountDown", 10000, false);
}
return 1;
}
Код:
forward CountDown();
public CountDown()
{
CountDownVar--; //Thanks for the fix.
new str[128];
if(CountDownVar == 0)
{
KillTimer(CountDownTimer);
GameModeExit();
CountDownVar = 4; //Edit thanks to Hiddos...i was sleepy :S
}
else
{
format(str, sizeof(str), "Count Down To Restart: %d", CountDownTimer);
GameTextForAll(str, 1000, 1);
}
return 1;
}
Re: whats The problem with this? D:? -
Toni - 12.09.2010
Theres nothing wrong with the counter,
except its your admin level checking.
I made a topic on Arithmetic symbols...trying looking at the examples and uses.
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 10)
{
settimer...do coding
return 1;
}
else SendClientMessage(...)
Re: whats The problem with this? D:? -
CuervO - 12.09.2010
pawn Код:
if (strcmp(cmd, "/restart", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 10)
{
SendClientMessage(playerid, COLOR_GREY, " You are not an lvl 10 Admin !");
return 1;
}
OOCOff(COLOR_OOC,"[OOC] Icecream-Bot: Server Is Restarting, Remember to /putgun and Stay Connected.");
CountDownTimer = SetTimer("CountDown", 1000, true);
CountDownVar = 10;
}
return 1;
}
pawn Код:
forward CountDown();
public CountDown()
{
CountDownVar--;
new str[64];
if(CountDownVar == 0)
{
KillTimer(CountDownTimer);
GameModeExit();
}
else
{
format(str, sizeof(str), "Count Down To Restart: %d", CountDownVar);
GameTextForAll(str, 1000, 1);
}
return 1;
}