Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Sistema de Evento y hora feliz By BadyX */
- /*
- http://img802.imageshack.us/img802/8524/samp000rf.png
- http://img208.imageshack.us/img208/3227/samp001mdx.png
- */
- #include <a_samp>
- /* Colores */
- #define Rojo 0xff001bff
- #define Amarillo 0xFFFF00AA
- #define Verde 0x33AA33AA
- #define Azul 0x8D8DFF00
- /* News */
- new Eventos = 0;
- new EstadoChat = 1;
- new Float:Posiciones[3];
- #if defined FILTERSCRIPT
- #else
- main(){}
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[128];
- new cmd[256];
- new idx;
- new tmp[256];
- cmd = strtok(cmdtext, idx);
- if (strcmp("/crearevento", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- if(Eventos == 1) return SendClientMessage(playerid, Rojo, # [Error] El modo evento ya esta activado );
- GetPlayerPos(playerid, Posiciones[0], Posiciones[1], Posiciones[2]);
- SendClientMessageToAll(Amarillo, "[Atencion] El modo evento fue activado, para participar usa {FF23FF}[/Participar]");
- Eventos = 1;
- return 1;
- }
- if (strcmp("/CerrarEvento", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- if(Eventos == 0) return SendClientMessage(playerid, Rojo, # [Error] El modo evento no esta activado );
- SendClientMessageToAll(Amarillo, "[Atencion] El modo evento fue desactivado");
- Eventos = 0;
- return 1;
- }
- if (strcmp("/Participar", cmdtext, true, 10) == 0)
- {
- if(Eventos == 0) return SendClientMessage(playerid, Rojo, # [Error] El modo evento no esta activado );
- SetPlayerPos(playerid,Posiciones[0], Posiciones[1], Posiciones[2]);
- SendClientMessage(playerid,Verde, # [Info] Entraste al modo evento);
- SendClientMessage(playerid,Verde, # [Info] Espera instrucciones);
- return 1;
- }
- if(strcmp(cmd, "/Evento", true) == 0 || strcmp(cmd, "/e", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[256];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result)) return SendClientMessage(playerid, Verde, "Usa /Evento [Texto]");
- if(EstadoChat == 0) return SendClientMessage(playerid, Rojo, "[Error]El chat para eventos esta desactivado");
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string),"(([Staff Evento] %s: %s ))", NombreEx(playerid), result);
- SendClientMessageToAll(Azul,string);
- return 1;
- }
- format(string, sizeof(string), "(([Usuario Evento] [%d] %s: %s ))",playerid, NombreEx(playerid), result);
- SendClientMessageToAll(Azul,string);
- return 1;
- }
- return 1;
- }
- if (strcmp("/ChatEvento", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- if(EstadoChat == 1)
- {
- SendClientMessageToAll(Amarillo, "[Atencion] El chat /Evento fue desactivado");
- EstadoChat = 0;
- return 1;
- }
- SendClientMessageToAll(Amarillo, "[Atencion] El chat /Evento fue activado");
- EstadoChat = 1;
- return 1;
- }
- if(strcmp(cmd, "/EventoArmas", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- new ArmaElegida;
- if(!strlen(tmp)) return SendClientMessage(playerid, Verde, "[Uso:] /DarArma [Id/Arma]");
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- ArmaElegida = strval(tmp);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- GivePlayerWeapon(i, ArmaElegida, 99999);
- }
- SendClientMessageToAll(Amarillo, "[Atencion] Un administrador dio armas a todos");
- return 1;
- }
- return 1;
- }
- if (strcmp("/EventoVida", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- if(Eventos == 0) return SendClientMessage(playerid, Rojo, # [Error] El modo evento no esta activado );
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerHealth(playerid,100);
- }
- SendClientMessageToAll(Amarillo, "[Atencion] Un administrador lleno la vida de todos");
- return 1;
- }
- if(strcmp(cmd, "/EventoSkin", true) == 0)
- {
- if(!strlen(tmp)) return SendClientMessage(playerid, Verde, "[Uso:] /EventoSkin [Id/Skin]");
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- new SkinElegido;
- SkinElegido = strval(tmp);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerSkin(playerid, SkinElegido);
- }
- SendClientMessageToAll(Amarillo, "[Atencion] Un administrador dio armas a todos");
- return 1;
- }
- return 1;
- }
- if (strcmp("/EventoChaleco", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Rojo, # [Error] Usted no esta logeado con rcon );
- if(Eventos == 0) return SendClientMessage(playerid, Rojo, # [Error] El modo evento no esta activado );
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerArmour(playerid,100);
- }
- SendClientMessageToAll(Amarillo, "[Atencion] Un administrador dio chalecos a todos");
- return 1;
- }
- if (strcmp("/EventoAyuda", cmdtext, true, 10) == 0)
- {
- new MsnAyuda[500];
- strcat(MsnAyuda, "{00A5FF}Creador: {F0F0F0}Badyx.\n\n");
- strcat(MsnAyuda, "{F5FF00}/Crearevento (Abre el modo evento) \n\n{F0F0F0}/CerrarEvento (Cierra el modo evento)\n/Participar (Si el modo evento esta activo, con este comando iras a la posicion del evento)\n");
- strcat(MsnAyuda, "{F5FF00}/Evento (Chat global para hablar)\n/ChatEvento (Activa/desactiva el chat evento)/EventoArmas (Da el arma elegida a todos los usuarios)\n/EventoVida (Da vida a todos los usuarios)\n/EventoChaleco (Da chaleco a todos los usuarios)\nEventoSkin (Da el skin definido a todos los usuarios)\n\n\n\n");
- strcat(MsnAyuda, "\n\n\n\n{F5FF00}Copyright © 2012-2013.");
- ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "{00A5FF}Creditos © BadyX.", MsnAyuda, "Aceptar", "");
- return 1;
- }
- return 0;
- }
- stock NombreEx(playerid)
- {
- new string[24];
- GetPlayerName(playerid,string,24);
- new str[24];
- strmid(str,string,0,strlen(string),24);
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if (str[i] == '_') str[i] = ' ';
- }
- return str;
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- //============================================================================//
- // //
- // FINAL DEL SCRIPT //
- // //
- // SI TE SIRVIO, RESPETA EL TRABAJO DEL CREADOR //
- // //
- //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment