[FilterScript] [FS] Count Down System
#1

·..·°Count Down System°·..·
• /count to start counting.

-------------------------------------------
V2 news: Antispam /count one time in 6sec.
-------------------------------------------

Download V2:

*****************

Mirrors:
V1:
http://www.sendspace.com/file/qvjk9r
V2:
http://www.sendspace.com/file/lzhv00
http://pastebin.com/f55c32ec9
Reply
#2

Nice Men!
Great Job!!
I Will Use It for My Server!!!
Reply
#3

Good, for new scripters.
Reply
#4

Sorry, but: It\'s very simpler than you\'ve made it.
And: string[458]; wtf? 40 are enough.
You should learn better PAWN and make a new version
Reply
#5

Quote:
Originally Posted by Maercell
Sorry, but: It\'s very simpler than you\'ve made it.
And: string[458]; wtf? 40 are enough.
You should learn better PAWN and make a new version
Yes,

pawn Code:
new pName[30];
    new string[458];
    GetPlayerName(playerid, pName, 30);
    format(string, 280, "*** %s started count.", pName);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
Correct me if im wrong but isn\'t the largest string 256?
Reply
#6

FIXED. ty for reporting.
Reply
#7

KK Thanks
Reply
#8

Hey!
Nice FS! I need a function.. Can you add an anti-spam function? Because player like spam the server with /count...
Thx!
Reply
#9

Tommorow will be V2. With anti-spam.
Reply
#10

I actually don\'t know if it is possible, but it could be like people near the one that starts the countdown will be freezed until the countdown ends?
Reply
#11

I dunno maybe this?

pawn Code:
forward CommandTimer(playerid);
pawn Code:
new commandused[MAX_PLAYERS];
new timer[MAX_PLAYERS];
pawn Code:
if(strcmp(cmdtext,"/count",true) == 0) {
    new pName[30];
    new string[458];
     timer[playerid] = SetTimerEx("command", time,playerid);
     commandused[playerid] = 1;
    GetPlayerName(playerid, pName, 30);
    format(string, 280, "*** %s started count.", pName);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
    for(new i; i < MAX_PLAYERS; i++) {
    GetPlayerPos(i,X,Y,Z);
    }
    SetTimer("count2",1000,0);
    SetTimer("count1",2000,0);
    SetTimer("countgo",3000,0);
    return 1;
    }
    return 0;
}
pawn Code:
public CommandTimer(playerid)
{
  commandused[playerid] = 0;
}
just a quick draft, not good with timers.
Reply
#12

V2:
Quote:

#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x33CCFFAA
forward count2();
forward count1();
forward countgo();
forward stop();
new bool:a;
new Float:X, Float:Y, Float:Z;
#else
#endif
////////////////////////////////////////////////////////////////////////////////
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/count",true) == 0) {
new pName[30];
new string[256];
if (a == false)
{
a = true;
GetPlayerName(playerid, pName, 30);
format(string, 280, "*** %s started count.", pName);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
for(new i; i < MAX_PLAYERS; i++) {
GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
GetPlayerPos(i,X,Y,Z);
}
SetTimer("count2",1000,0);
SetTimer("count1",2000,0);
SetTimer("countgo",3000,0);
SetTimer("stop",6000,0);

}
else SendClientMessage(playerid, 0xFF9900AA, "Its allready started!");
return 1;
}

return 0;
}
////////////////////////////////////////////////////////////////////////////////
public count2()
{
for(new i; i < MAX_PLAYERS; i++) {
GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n ~~n~~g~-~y~ 2 ~g~-",1000,3);
GetPlayerPos(i,X,Y,Z);
}
}
////////////////////////////////////////////////////////////////////////////////
public count1()
{
for(new i; i < MAX_PLAYERS; i++) {
GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n ~~n~~g~-~y~ 1 ~g~-",1000,3);
GetPlayerPos(i,X,Y,Z);
}
}
////////////////////////////////////////////////////////////////////////////////
public countgo()
{
for(new i; i < MAX_PLAYERS; i++) {
GetPlayerPos(i,X,Y,Z);
GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n ~~n~~g~-~y~]~g~-~g~START~g~-~y~]~g~-",1000,3);
PlayerPlaySound(i,1057,X,Y,Z);
}
}
public stop()
{
a = false;
}
//////////////////
// © Fumis 2009 //
//////////////////

Reply
#13

I added an antispam device and made the entire thing neater.

Link

Updates include:
  • Only Uses 1 timer now!
  • Made the strings considerably smaller, therefore less memory required!
  • Only 1 timer may run at once, anyone that tries to start an additional timer while one is running will be told it is busy
Ignore the copyright I put at the bottom, that was just for the sake of it, you are free to modify it as you wish.

Thread starter please take note, it is much easier to work on scripts when you use indentations and leave gaps between callbacks etc.

As for freezing the people within a given radius, it\'s definetely possible, but that might take me a few more minutes!

For the record, I am Thomas_Conroy!
Reply
#14

Thx! Now it\'s a gr8 FS! Thx a lot!
Reply
#15

Quote:
Originally Posted by [FF
Nimphious ]
...
Correct me if im wrong but isn\'t the largest string 256?
No, the largest string is a big number, in the millions or even billions. 256 has been used because someone started with it.
Reply
#16

Quote:
Originally Posted by TheATheBTheC..
Quote:
Originally Posted by [FF
Nimphious ]
...
Correct me if im wrong but isn\'t the largest string 256?
No, the largest string is a big number, in the millions or even billions. 256 has been used because someone started with it.
At the end of the day it doesn\'t matter what the biggest string is, the string in question only needs to be around 60 characters max, so a string of length 100 would cover it with a lot of room to spare. The larger the string you use, the more memory you waste!
Reply
#17

tnx..really good fs
Reply
#18

Yes it is.
Reply
#19

V2 links added.
Reply
#20

This could\'ve been made much more easier, there\'s about 4 timers for one function, anyway good job.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)