quick help, probably easy -
wilcock33 - 17.12.2009
hello!
i have a new years countdown:
Код:
#define FILTERSCRIPT
#include <a_samp>
#include <a_players>
new counter;
new countTimer;
forward timer();
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
counter = 0;
return 1;
}
public OnFilterScriptExit()
{
counter = 0;
return 1;
}
#else
main()
{
print("\n------------------------------------------");
print(" NewYearCountdown Script");
print("------------------------------------------\n");
}
#endif
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF00FF,"Welcome to the New Year's Party!");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/count", true) || !strcmp(cmdtext, "/countdown", true))
{
if(counter != 0)
return SendClientMessage(playerid, 0xFFFF00FF, "The new-year countdown is already running...print what till next year!");
counter = 60;
countTimer = SetTimer("timer", 1000, true);
return true;
}
return 0;
}
public timer()
{
if(counter > 0)
{
new string[3];
format(string, sizeof(string), "%d", counter);
GameTextForAll(string, 500, 3);
}
else
{
GameTextForAll("HAPPY NEW YEAR 2010!!!", 50000, 5);
PlayerPlaySound(playerid, 1076, 0.0, 0.0, 0.0);
counter = 0;
KillTimer(countTimer);
}
counter--;
return true;
}
awhen the countdown reaches zero, i want it to play the sound as in the script, but it wont, when i compile, i get an error saying (undefined symbol "plqayerid")
why, please help!!
Re: quick help, probably easy -
matute - 17.12.2009
At public timer() you will put public timer(playerid)
At the forward put forward timer(playerid);
Maybe, i dont know good, try that
Re: quick help, probably easy -
wilcock33 - 17.12.2009
didnt work, anyone else?
thanks for the help though!
Re: quick help, probably easy -
Faraday - 17.12.2009
Код:
public timer()
{
if(counter > 0)
{
new string[3];
format(string, sizeof(string), "%d", counter);
GameTextForAll(string, 500, 3);
}
else
{
for(new i=0;i<MAX_PLAYERS;i++)
{
GameTextForAll("HAPPY NEW YEAR 2010!!!", 50000, 5);
PlayerPlaySound(playerid, 1076, 0.0, 0.0, 0.0);
}
counter = 0;
KillTimer(countTimer);
}
counter--;
return true;
}
try this
Re: quick help, probably easy -
wilcock33 - 17.12.2009
Код:
C:\Documents and Settings\Server and Work\Desktop\San Andreas Test Server\filterscripts\newyear.pwn(69) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Server and Work\Desktop\San Andreas Test Server\filterscripts\newyear.pwn(77) : error 030: compound statement not closed at the end of file (started at line 58)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
?? HELP!!
Re: quick help, probably easy -
Faraday - 17.12.2009
Код:
public timer()
{
if(counter > 0)
{
new string[3];
format(string, sizeof(string), "%d", counter);
GameTextForAll(string, 500, 3);
}
else
{
for(new i=0;i<MAX_PLAYERS;i++)
{
GameTextForAll("HAPPY NEW YEAR 2010!!!", 50000, 5);
PlayerPlaySound(i, 1076, 0.0, 0.0, 0.0);
}
counter = 0;
KillTimer(countTimer);
}
counter--;
return true;
}
fixed.
Re: quick help, probably easy -
wilcock33 - 17.12.2009
thanks man, ill go try it!
EDIT: works Perfectly, please come to our new years party, IP BELOW!!