Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // countdown
- #include <a_samp>
- #define countdownountdown_dialog 1031
- #define MAX_Input_Countdown 50
- new bool:Cstats[MAX_PLAYERS];
- new timer;
- enum var{nn};new Variable[var];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" MAX_Input_Countdown enjoy ! ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Cstats[playerid] = false;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/try", cmdtext, true, 3) == 0)
- {
- countdown(playerid);
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == countdownountdown_dialog)
- {
- if(!response)
- {
- Cstats[playerid] = false;
- }
- else
- {
- new string[24];
- Variable[nn] = strval(inputtext);
- if ( Variable[nn] > MAX_Input_Countdown )
- {
- SendClientMessage(playerid, 0xFF0000FF, "ERROR MAX Countdown is exceed");
- Cstats[playerid] = false;
- countdown(playerid);
- return 1;
- }
- else
- {
- format( string, sizeof(string), "~y~%i",Variable[nn]);
- GameTextForAll( string , 5000, 3 );
- timer = SetTimer("count", 1000, true);
- Cstats[playerid] = false;
- }
- }
- return 1;
- }
- return 0;
- }
- forward count(); public count() {
- new string[24];
- if(Variable[nn] == 0)
- {
- KillTimer(timer);
- GameTextForAll( "goo" , 5000, 3 );
- return 1;
- }
- Variable[nn] --;
- format( string, sizeof(string), "~y~%i" ,Variable[nn]);
- GameTextForAll( string , 5000, 3 );
- return 1;
- }
- countdown(playerid)
- {
- if(Cstats[playerid] == true) return SendClientMessage(playerid, 0xFF0000FF, "ERROR CMD ");
- ShowPlayerDialog(playerid, countdownountdown_dialog, DIALOG_STYLE_INPUT, "{FF0000}countdownountdown", " switch {00FF00} any number at secondes(sec) ", "O", "X");
- Cstats[playerid] = true;
- return 1;
- }
- // By Golf
Advertisement
Add Comment
Please, Sign In to add comment