02.06.2010, 17:15
Hey guys i've made a countdown system but i wanna no how to add sounds to them..
If you can help please reply thanks
Heres the code
If you can help please reply thanks
Heres the code
Код:
#define FILTERSCRIPT
#include <a_samp>
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(" Countdown");
print("------------------------------------------\n");
}
#endif
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/countdown", true) || !strcmp(cmdtext, "/countdown", true))
{
if(counter != 0)
return SendClientMessage(playerid,0x004BFFFF, "ERROR: /countdown is already in use, Try again in a few minutes.");
countTimer = SetTimer("timer", 1000, true);
return true;
}
return 0;
}
public timer()
{
counter++;
if(counter == 1)
GameTextForAll("3", 500, 3);
else if(counter == 2)
GameTextForAll("2", 500, 3);
else if(counter == 3)
GameTextForAll("1", 500, 3);
else if(counter == 4)
{
GameTextForAll("GO GO GO!!", 500, 2000);
counter = 0;
KillTimer(countTimer);
}
return true;
}

