Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define CALLBACK:%0(%1) forward%0(%1); public%0(%1)
- #define B "{FFFFFF}" //white
- #define R "{BC0000}" //red
- #define G "{009100}" //green
- #define TIMER_COUNTDOWN (1*1000)
- #define COLOR_N 0x00000055
- #define COLOR_B 0xFFFDFFFF
- #define COLOR_R 0xC00000FF
- #define COLOR_G 0x009800FF
- #define MAX_COUNTDOWN (10)
- static Text:CountdownTD[MAX_COUNTDOWN],
- DataCountdown[4],bool:ActiveCountdown,KillCountdown;
- CALLBACK: OnFilterScriptInit()
- {
- print("\n**************************************");
- print(" Countdown Timer ");
- print(" Date: 29/09/2013 ");
- print(" Author: OTACON ");
- print(" --* Downloaded with Success!!. *-- ");
- print("***************************************\n");
- SendRconCommand("hostname Countdown Timer");
- SendRconCommand("gamemodetext By OTACON");
- CountdownTD[0] = TextDrawCreate(529.000000, 354.000000, "_");
- TextDrawAlignment(CountdownTD[0], 2);
- TextDrawBackgroundColor(CountdownTD[0], 255);
- TextDrawFont(CountdownTD[0], 2);
- TextDrawLetterSize(CountdownTD[0], 0.189999, 9.799999);
- TextDrawColor(CountdownTD[0], -1);
- TextDrawSetOutline(CountdownTD[0], 1);
- TextDrawSetProportional(CountdownTD[0], 1);
- TextDrawUseBox(CountdownTD[0], 1);
- TextDrawBoxColor(CountdownTD[0], COLOR_N);
- TextDrawTextSize(CountdownTD[0], -24.000000, 179.000000);
- CountdownTD[1] = TextDrawCreate(529.000000, 385.000000, "_");
- TextDrawAlignment(CountdownTD[1], 2);
- TextDrawBackgroundColor(CountdownTD[1], COLOR_G);
- TextDrawFont(CountdownTD[1], 3);
- TextDrawLetterSize(CountdownTD[1], 0.799999, 4.599999);
- TextDrawColor(CountdownTD[1], COLOR_B);
- TextDrawSetOutline(CountdownTD[1], 1);
- TextDrawSetProportional(CountdownTD[1], 1);
- TextDrawLetterSize(CountdownTD[1], 0.799999, 4.599999);
- CountdownTD[2] = TextDrawCreate(458.000000, 422.000000, "DAYS");
- TextDrawLetterSize(CountdownTD[2], 0.250000, 1.900000);
- TextDrawBackgroundColor(CountdownTD[2], COLOR_G);
- CountdownTD[3] = TextDrawCreate(505.000000, 422.000000, "HOURS");
- TextDrawLetterSize(CountdownTD[3], 0.220000, 1.900000);
- TextDrawBackgroundColor(CountdownTD[3], COLOR_G);
- CountdownTD[4] = TextDrawCreate(552.000000, 422.000000, "MINUTES");
- TextDrawLetterSize(CountdownTD[4], 0.179999, 1.900000);
- TextDrawBackgroundColor(CountdownTD[4], COLOR_G);
- CountdownTD[5] = TextDrawCreate(598.000000, 422.000000, "SECONDS");
- TextDrawLetterSize(CountdownTD[5], 0.159999, 1.900000);
- TextDrawBackgroundColor(CountdownTD[5], COLOR_G);
- CountdownTD[6] = TextDrawCreate(528.000000, 349.000000, "COUNTDOWN TIMER");
- TextDrawLetterSize(CountdownTD[6], 0.259999, 2.499998);
- TextDrawBackgroundColor(CountdownTD[6], COLOR_R);
- CountdownTD[7] = TextDrawCreate(575.000000, 369.000000, "By OTACON");
- TextDrawLetterSize(CountdownTD[7], 0.189999, 1.599999);
- TextDrawBackgroundColor(CountdownTD[7], COLOR_G);
- for(new index=2; index<MAX_COUNTDOWN; index++) {
- TextDrawAlignment(CountdownTD[index], 2);
- TextDrawFont(CountdownTD[index], 2);
- TextDrawColor(CountdownTD[index], -1);
- TextDrawSetOutline(CountdownTD[index], 1);
- TextDrawSetProportional(CountdownTD[index], 1); }
- CountdownTD[8] = TextDrawCreate(530.000000, 331.000000, "PLACE YOUR MESSAGE HERE!...");
- TextDrawAlignment(CountdownTD[8], 2);
- TextDrawBackgroundColor(CountdownTD[8], 255);
- TextDrawFont(CountdownTD[8], 1);
- TextDrawLetterSize(CountdownTD[8], 0.260000, 1.600000);
- TextDrawColor(CountdownTD[8], -1);
- TextDrawSetOutline(CountdownTD[8], 1);
- TextDrawSetProportional(CountdownTD[8], 1);
- TextDrawUseBox(CountdownTD[8], 1);
- TextDrawBoxColor(CountdownTD[8], COLOR_N);
- TextDrawTextSize(CountdownTD[8], -17.000000, 180.000000);
- CountdownTD[9] = TextDrawCreate(438.000000, 316.000000, "MESSAGE:");
- TextDrawBackgroundColor(CountdownTD[9], COLOR_G);
- TextDrawFont(CountdownTD[9], 1);
- TextDrawLetterSize(CountdownTD[9], 0.260000, 1.600000);
- TextDrawColor(CountdownTD[9], COLOR_B);
- TextDrawSetOutline(CountdownTD[9], 1);
- TextDrawSetProportional(CountdownTD[9], 1);
- return true;
- }
- CALLBACK: OnFilterScriptExit() {
- print("\n**************************************");
- print(" Countdown Timer ");
- print(" Date: 29/09/2013 ");
- print(" Author: OTACON ");
- print(" --* Loaded with Success!!. *-- ");
- print("***************************************\n");
- SendRconCommand("hostname Countdown Timer");
- SendRconCommand("gamemodetext By OTACON");
- for(new index=0; index<MAX_COUNTDOWN; index++) \
- TextDrawHideForAll(CountdownTD[index]), \
- TextDrawDestroy(CountdownTD[index]);
- return true;
- }
- /*
- CALLBACK: OnPlayerDisconnect(playerid, reason) {
- for(new index=0; index<MAX_COUNTDOWN; index++) \
- TextDrawHideForAll(playerid,CountdownTD[index]), \
- TextDrawDestroy(CountdownTD[index]);
- return true;
- }
- */
- CALLBACK: UpdateCountdown() {
- new data[50];
- if(!ActiveCountdown)
- {
- for(new index=0; index<MAX_COUNTDOWN; index++) TextDrawHideForAll(CountdownTD[index]);
- for(new index=0; index<4; index++) DataCountdown[index]=0;
- KillTimer(KillCountdown);
- }
- else
- {
- static CountdownTemp[2];
- DataCountdown[3]--;
- if(DataCountdown[3]>=60) DataCountdown[3]=0, DataCountdown[2]--, CountdownTemp[0]++;
- if(CountdownTemp[0]>=60) CountdownTemp[0]=0, DataCountdown[1]--, CountdownTemp[1]++;
- if(CountdownTemp[1]>=24) CountdownTemp[1]=0, DataCountdown[0]--;
- if(DataCountdown[3]<=0 && DataCountdown[2] >= 1) DataCountdown[2]--, DataCountdown[3]=59; //Faltaba esto, pequeño error de Otacon.
- if(DataCountdown[2]<=0) DataCountdown[2]=0;
- if(DataCountdown[1]<=0) DataCountdown[1]=0;
- if(DataCountdown[0]<=0) DataCountdown[0]=0;
- format(data,sizeof(data),"%02d:%02d:%02d:%02d",DataCountdown[0],DataCountdown[1],DataCountdown[2],DataCountdown[3]);
- TextDrawSetString(CountdownTD[1],data);
- for(new index=0; index<MAX_COUNTDOWN; index++) \
- TextDrawHideForAll(CountdownTD[index]),\
- TextDrawShowForAll(CountdownTD[index]);
- if(DataCountdown[0]<=0 && DataCountdown[1]<=0 && DataCountdown[2]<=0 && DataCountdown[3]<=0)
- {
- ActiveCountdown=false;
- //CountdownFunction();
- SendClientMessageToAll(-1, ""B"[!] "G"The countdown timer is over"B"!");
- for(new index=0; index<2; index++) \
- CountdownTemp[index]=0;
- }
- }
- }
- /*
- stock CountdownFunction() {
- for(new msg=0; msg<100; msg++) \
- SendClientMessageToAll(-1, " "B"[ ! ] "G"The countdown timer is over"B"!."), \
- SendClientMessageToAll(-1, " "B"[ ! ] "R"COUNTDOWN TIMER - By OTACON"B"!.");
- }*/
- COMMAND:countdown(playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1," "B"[ ! ] "G"You Not Authorized to Use this command"B"!.");
- if(sscanf(params,"dddds[20]",params[0],params[1],params[2],params[3],params[4])) return SendClientMessage(playerid, -1, " "B"[ ! ] "G"Type the command: "R"/countdown "G"[days] [hours] [minutes] [seconds] [message]");
- if(strval(params[0])<0||strval(params[0])>30) return SendClientMessage(playerid, -1, " "B"[ ! ] "G"not go below 0 or above 30 days"B"!.");
- if(strval(params[1])<0||strval(params[1])>12) return SendClientMessage(playerid, -1, " "B"[ ! ] "G"not go below 0 or above 12 hours"B"!.");
- if(strval(params[2])<0||strval(params[2])>60) return SendClientMessage(playerid, -1, " "B"[ ! ] "G"not go below 0 or above 60 minutes"B"!.");
- if(strval(params[3])<0||strval(params[3])>60) return SendClientMessage(playerid, -1, " "B"[ ! ] "G"not go below 0 or above 60 seconds"B"!.");
- if(strlen(params[4])<0||strlen(params[4])>20) return SendClientMessage(playerid, -1, " "B"[ ! ] "G"not go below 0 or above 20 characters"B"!.");
- ActiveCountdown=false;
- ActiveCountdown=true;
- for(new index=0; index<4; index++) \
- DataCountdown[index]=0;
- DataCountdown[0]=params[0];
- DataCountdown[1]=params[1];
- DataCountdown[2]=params[2];
- DataCountdown[3]=params[3];
- TextDrawSetString(CountdownTD[8],params[4]);
- for(new index=0; index<MAX_COUNTDOWN; index++) \
- TextDrawHideForAll(CountdownTD[index]),\
- TextDrawShowForAll(CountdownTD[index]);
- KillTimer(KillCountdown);
- KillCountdown=SetTimer("UpdateCountdown",TIMER_COUNTDOWN,true);
- SendClientMessage(playerid, -1, " "B"[ ! ] "G"COUNTDOWN TIMER - ACTIVATED"B"!.");
- return true;
- }
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement