02.01.2011, 08:12
Can Someone give me a script code for a screen countdown? (3,2,1,go). I want one but no for Admins use, i want to be able to do it everyone in my server with a command! thnx!
CMD:count(playerid,params[]) {
new ccseconds;
if (sscanf(params, "i", ccseconds)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /count [seconds]");
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this command");
return 1;
}
if (isnull(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration in seconds.");
if (!IsNumeric(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration in seconds.");
if (ccseconds < 1) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration between 1 and 20 seconds");
if (ccseconds > 20) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration between 1 and 20 seconds");
if (cseconds) return SendClientMessage(playerid, COLOR_BRIGHTRED, "A countdown is already running.");
CountingTimer = SetTimer("ctimer", 1000, true);
format(cstring,40,"You started a countdown of %d seconds.",ccseconds);
SendClientMessage(playerid,COLOR_LIGHTBLUE, cstring);
cseconds = ccseconds+1;
cCount[playerid] = 1;
return 1;
}
new Count = 3;
if(strcmp(cmdtext,"/count",true) == 0)
{
if(Count < 3) return SendClientMessage(playerid,red,"Countdown is already in progress");
SetTimer("CountDown",1000,0);
return 1;
}
public CountDown()
{
format(string,sizeof(string),"%d",Count);
if(Count == 0)
{
GameTextForAll("Go go go!",1500,3);
Count = 3;
}
else
{
GameTextForAll(string,1500,3);
Count--;
SetTimer("CountDown",1000,0);
}
return 1;
}
pawn Код:
pawn Код:
pawn Код:
|
I get the following errors!
warning 235: public function lacks forward declaration (symbol "CountDown") : error 017: undefined symbol "string" : error 017: undefined symbol "string" : error 029: invalid expression, assumed zero |
new Count = 3;
new Count = 3;
new string[256];
forward CountDown();