Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*********** Sistema Registro & Clanes con Tops DINI & [C]Admin ***************/
- //==============================================================================
- // # Sistema Registro & Clanes con Tops DINI & [C]Admin
- // # Autor: Zoutdaxv. .ConecCionMex. .Infierno
- // # Versión: 0.4
- // # Fecha: 20/Feb/2010
- // # Actualizado: 05/Jun/2010
- // # Creditos:
- // - Infierno Sistema de Clanes en DINI
- // - » RyDeR «: idea In Game ColorPicker (Sin copiar & pegar).
- // - Zamaroht: TDE & Función RGB.
- // - ConecCionMex y CristianDJ[C]Admin Sistema de Admistracion
- //==============================================================================
- #include <a_samp>
- #include <dini>
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- //==============================================================================
- #define DLG_TOP_PLAYERS 1500
- #define DLG_TOP_CLANES 1501
- #define DLG_PLY_INFO 1503
- #define DLG_CLAN_INFO 1504
- //==============================================================================
- /* -= Colores =- */
- #define Azul 0x375FFFFF
- #define Rojo 0xFF0000FF
- #define Verde 0x00FF00FF
- #define Amarillo 0xFFFF00AA5
- #define Naranja 0xFF8000FF
- #define ROJO 0xAA3333AA
- #define NARANJA 0xF97804FF
- #define BLANCO 0xEFEFF7AA
- #define LIGHTBLUE 0x00C2ECFF
- #define NICESKY 0x99FFFFAA
- //==============================================================================
- //TOP PLAYERS & TOP CLANES
- enum info
- {
- NickTOP[32],
- AsesinatosTOP,
- MuertesTOP,
- Float:RatioTOP,
- Nivel,
- Tsay,
- Congelado,
- CongelarTiempo,
- Carcel,
- CarcelTiempo
- };
- new TopInfo[11][info];
- new Conteo;
- new Menu:armas;
- new SaltosBici[MAX_PLAYERS];
- new CarcelTimer[MAX_PLAYERS];
- new CongelarTimer[MAX_PLAYERS];
- new sendername[MAX_PLAYER_NAME];
- new PlayerInfo[MAX_PLAYERS][info];
- new Top[11];
- new NOMBRE[3000][32];
- new Float:VALOR[3000];
- new EnTop[3000];
- //==============================================================================
- //Strings diálogos:
- new DLG_TOP_PLY_STR[1024];
- new DLG_TOP_CLAN_STR[1024];
- new DLG_INFO_PLY_STR[1024];
- new DLG_INFO_CLAN_STR[1024];
- //==============================================================================
- //JUGADORES:
- new bool:Registrado[MAX_PLAYERS] = false;
- new bool:Ingresado[MAX_PLAYERS] = false;
- new Nickname[MAX_PLAYERS][MAX_PLAYER_NAME];
- new Asesinatos[MAX_PLAYERS];
- new Muertes[MAX_PLAYERS];
- new Float:Ratio[MAX_PLAYERS];
- //Combinador de colores:
- new bool:CColor[MAX_PLAYERS] = false;
- new CSelec[MAX_PLAYERS] = 1;
- new COLORES[MAX_PLAYERS][4];//0 ROJO, 1 VERDE, 2 AZUL, 3 Transparencia
- //==============================================================================
- //TextDraws Combinador de colores
- new Text:NumColor[MAX_PLAYERS];
- new Text:Color[MAX_PLAYERS];
- new Text:CComb[MAX_PLAYERS];
- new Text:Comb[MAX_PLAYERS];
- //==============================================================================
- //CLANES:
- new Clan_TAG[MAX_PLAYERS][4];
- new Clan_ID[MAX_PLAYERS];
- new Invitacion[MAX_PLAYERS][32];
- new bool:EnClan[MAX_PLAYERS];
- //==============================================================================
- new PlayerColors[200] = {
- 0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,
- 0xFF1493FF,0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,
- 0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,
- 0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,0x5C1ACCFF,
- 0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
- 0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,
- 0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,
- 0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,0x4B8987FF,0x491B9EFF,
- 0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
- 0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,
- 0x42ACF5FF,0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,
- 0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,
- 0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,0x10C9C5FF,
- 0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
- 0xD8C762FF,0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,
- 0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,
- 0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0x534081FF,
- 0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
- 0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,
- 0x275222FF,0xF09F5BFF,0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,
- 0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,0xB98519FF,0x388EEAFF,
- 0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
- 0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,
- 0x3C1C0DFF,0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,
- 0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,
- 0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,0x184D3BFF,
- 0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
- 0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,
- 0xE59338FF,0xEEDC2DFF,0xD8C762FF,0xD8C762FF
- };
- public OnFilterScriptInit()
- {
- new
- Archivo[64];
- print("\n/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/");
- print("/=/=/=/=/=Sistema De Clanes-Dini-=/=/=/=/");
- print("/=/=/=/=/=/=/=/= -Mas- =/=/=/=/=/=/=/=/=/");
- print("/=/=/= -Sistema de Administracion- =/=/=/");
- print("/=/=/=/=-Infierno + ConecCionMex-=/=/=/=/");
- print("/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/\n");
- SetTimer("ActualizarListaJugadores", 1500, 0);
- SetTimer("ActualizarTopPlayers", 3500, 0);
- SetTimer("ActualizarTopClanes", 5000, 0);
- format(Archivo, sizeof Archivo, "Clan.ini");
- if(!dini_Exists(Archivo)) {
- dini_Create(Archivo);
- dini_IntSet(Archivo, "Clanes_Creados", 0);
- }
- if(!fexist("Jugadores.txt")) {
- new
- File:file = fopen("Jugadores.txt", io_write);
- fclose(file);
- }
- if(!fexist("Clanes.txt")) {
- new
- File:file = fopen("Clanes.txt", io_write);
- fclose(file);
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerRequestSpawn(playerid)
- {
- SaltosBici[playerid] = 0;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new
- Archivo[64];
- GetPlayerName(playerid, Nickname[playerid], MAX_PLAYER_NAME);
- if(strfind(Nickname[playerid], "[", true) != -1 || strfind(Nickname[playerid], "]", true) != -1)
- {
- SendClientMessage(playerid, ROJO, "Tu nick no puede contener corchetes");
- return Kick(playerid);
- }
- //Verificar registro:
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", Nickname[playerid]);
- if(dini_Exists(Archivo)) Registrado[playerid] = true;
- SetPlayerColor(playerid, PlayerColors[playerid]);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new file[MAX_PLAYERS];
- Invitacion[playerid][0] = 0;
- Clan_ID[playerid] = 0;
- Clan_TAG[playerid][0] = 0;
- EnClan[playerid] = false;
- Registrado[playerid] = false;
- Ingresado[playerid] = false;
- Asesinatos[playerid] = 0;
- Muertes[playerid] = 0;
- Ratio[playerid] = 0.0;
- dini_IntSet(file, "Nivel", PlayerInfo[playerid][Nivel]);
- //==========================//
- new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- switch(reason)
- {
- case 0: format(string, sizeof(string), "%s Ha salido Del Server.[[(Crash]]", pname);
- case 1: format(string, sizeof(string), "%s Ha salido Del Server. ", pname);
- case 2: format(string, sizeof(string), "%s Ha salido Del Server. [[Kick/Ban]]", pname);
- }
- SendClientMessageToAll(Amarillo, string);
- //===================================
- new Nombre[MAX_PLAYERS]; GetPlayerName(playerid, Nombre, sizeof(Nombre));
- format(file, sizeof(file), "Sadmin/Jugadores/%s.ini", Nombre);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new
- Archivo[64],
- TempMuertes,
- TempAsesinatos;
- Muertes[playerid]++;
- Ratio[playerid] = float(Asesinatos[playerid]) / float(Muertes[playerid]);
- if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
- {
- Asesinatos[killerid]++;
- if(Muertes[killerid] == 0) Ratio[killerid] = float(Asesinatos[playerid]);
- else Ratio[killerid] = float(Asesinatos[killerid]) / float(Muertes[killerid]);
- }
- if(IsPlayerConnected(playerid) && Ingresado[playerid] == true)
- {
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", Nickname[playerid]);
- if(dini_Exists(Archivo))
- {
- dini_IntSet(Archivo, "Muertes", Muertes[playerid]);
- dini_FloatSet(Archivo, "Ratio", Ratio[playerid]);
- }
- if(EnClan[playerid] == true)
- {
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- if(dini_Exists(Archivo))
- {
- dini_IntSet(Archivo, "Muertes", dini_Int(Archivo, "Muertes")+1);
- dini_FloatSet(Archivo, "Ratio", float(dini_Int(Archivo, "Asesinatos")) / float(dini_Int(Archivo, "Muertes")));
- }
- }
- }
- if(IsPlayerConnected(killerid) && Ingresado[killerid] == true && killerid != INVALID_PLAYER_ID)
- {
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", Nickname[killerid]);
- if(dini_Exists(Archivo))
- {
- dini_IntSet(Archivo, "Asesinatos", Asesinatos[killerid]);
- dini_FloatSet(Archivo, "Ratio", Ratio[killerid]);
- }
- if(EnClan[killerid] == true)
- {
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[killerid]);
- if(dini_Exists(Archivo))
- {
- TempMuertes = dini_Int(Archivo, "Muertes");
- TempAsesinatos = dini_Int(Archivo, "Asesinatos");
- dini_IntSet(Archivo, "Asesinatos", TempAsesinatos+1);
- if(TempMuertes == 0) dini_FloatSet(Archivo, "Ratio", float(TempAsesinatos));
- else dini_FloatSet(Archivo, "Ratio", float(TempAsesinatos) / float(TempMuertes));
- }
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new
- Nick[MAX_PLAYER_NAME],
- texto[128];
- if(text[0] == '!' && EnClan[playerid] == true)
- {
- GetPlayerName(playerid, Nick, MAX_PLAYER_NAME);
- format(texto, sizeof texto, "%s: %s", Nick, text[1]);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(EnClan[i] == EnClan[playerid])
- {
- SendClientMessage(playerid, LIGHTBLUE, texto);
- }
- }
- }
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new
- cmd[20],
- tmp[20],
- tmp2[20],
- tmp3[24],
- string[64],
- Archivo[64],
- Nick[MAX_PLAYER_NAME],
- longitud,
- id,
- File:file,
- idx;
- cmd = strtok(cmdtext, idx);
- if(!strcmp("/kill", cmd, true))
- {
- SetPlayerHealth(playerid, 0.0);
- return 1;
- }
- if(!strcmp("/register", cmd, true))
- {
- if(Registrado[playerid] == true) return SendClientMessage(playerid, ROJO, "Ya estás registrado");
- tmp = strtok(cmdtext, idx);
- longitud = strlen(tmp);
- if(longitud == 0) return SendClientMessage(playerid, BLANCO, "Uso /register [Contraseña]");
- if(longitud < 3 || longitud > 16)
- {
- return SendClientMessage(playerid, ROJO, "La contraseña debe tener de 3 a 16 caracteres");
- }
- Registrar(playerid, tmp);
- return 1;
- }
- if(!strcmp("/login", cmd, true))
- {
- if(Registrado[playerid] == false) return SendClientMessage(playerid, ROJO, "No estás registrado");
- if(Ingresado[playerid] == true) return SendClientMessage(playerid, ROJO, "Ya estás logueado");
- tmp = strtok(cmdtext, idx);
- longitud = strlen(tmp);
- if(longitud == 0) return SendClientMessage(playerid, BLANCO, "Uso /login [Contraseña]");
- Login(playerid, tmp);
- return 1;
- }
- if(!strcmp(cmd, "/stats", true))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, BLANCO, "Usa: /stats [id]");
- id = strval(tmp);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, ROJO, "Jugador no conectado");
- if(Ingresado[id] == false) return SendClientMessage(playerid, ROJO, "Ese jugador no está ingresado");
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", Nickname[id]);
- format(DLG_INFO_PLY_STR, sizeof DLG_INFO_PLY_STR, "~.~");
- if(dini_Exists(Archivo))
- {
- format(DLG_INFO_PLY_STR, sizeof DLG_INFO_PLY_STR, "Asesinatos: %d\n", dini_Int(Archivo, "Asesinatos"));
- format(DLG_INFO_PLY_STR, sizeof DLG_INFO_PLY_STR, "%sMuertes: %d\n", DLG_INFO_PLY_STR, dini_Int(Archivo, "Muertes"));
- format(DLG_INFO_PLY_STR, sizeof DLG_INFO_PLY_STR, "%sRatio: %d\n", DLG_INFO_PLY_STR, dini_Float(Archivo, "Ratio"));
- format(DLG_INFO_PLY_STR, sizeof DLG_INFO_PLY_STR, "%sClan: [%s]", DLG_INFO_PLY_STR, dini_Get(Archivo, "Clan"));
- }
- format(string, sizeof string, "Stadísticas de %s (%d)", Nickname[id], id);
- ShowPlayerDialog(playerid, DLG_PLY_INFO, DIALOG_STYLE_MSGBOX, string, DLG_INFO_PLY_STR, "Aceptar", "Cancelar");
- return 1;
- }
- if(!strcmp(cmd, "/Topplayers", true))
- {
- ShowPlayerDialog(playerid, DLG_TOP_PLAYERS, DIALOG_STYLE_LIST, "Top Players", DLG_TOP_PLY_STR, "Aceptar", "Cancelar");
- return 1;
- }
- if(!strcmp(cmd, "/Topclanes", true))
- {
- ShowPlayerDialog(playerid, DLG_TOP_CLANES, DIALOG_STYLE_LIST, "Top Clanes", DLG_TOP_CLAN_STR, "Aceptar", "Cancelar");
- return 1;
- }
- if(!strcmp(cmd, "/clan", true))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, BLANCO, "Usa: /clan [info, crear, invitar, entrar, salir, expulsar, color, colorh] [Nombre] [TAG]");
- if(!strcmp(tmp, "crear", true))
- {
- if(Ingresado[id] == false) return SendClientMessage(playerid, ROJO, "Necesitas estar logueado para usar este comando");
- if(EnClan[playerid] == true) return SendClientMessage(playerid, ROJO, "Ya tienes clan");
- tmp2 = strtok(cmdtext, idx);
- tmp3 = strrest(cmdtext, idx);
- if(!strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid, BLANCO, "Usa: /clan crear [TAG] [Nombre]");
- if(strlen(tmp2) < 1 || strlen(tmp2) > 3) return SendClientMessage(playerid, ROJO, "Sólo de 1 a 3 caracteres");
- if(strlen(tmp3) < 3 || strlen(tmp3) > 24) return SendClientMessage(playerid, ROJO, "Sólo de 3 a 24 caracteres");
- if(strfind(tmp2, "[", true) != -1 || strfind(tmp2, "]", true) != -1)
- {
- return SendClientMessage(playerid, ROJO, "Sin '[' ']' (corchetes) .");
- }
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", tmp2);
- if(!dini_Exists(Archivo))
- {
- format(Clan_TAG[playerid], 4, "%s", tmp2);
- Clan_ID[playerid] = dini_Int("Clan.ini", "Clanes_Creados")+1;
- dini_IntSet("Clan.ini", "Clanes_Creados", Clan_ID[playerid]);
- dini_Create(Archivo);
- dini_IntSet(Archivo, "ID", Clan_ID[playerid]);
- dini_Set(Archivo, "Nombre", tmp3);
- dini_Set(Archivo, "TAG", tmp2);
- dini_IntSet(Archivo, "Color", id);
- dini_Set(Archivo, "Lider", Nickname[playerid]);
- dini_IntSet(Archivo, "Miembros", 1);
- dini_IntSet(Archivo, "Asesinatos", 0);
- dini_IntSet(Archivo, "Muertes", 0);
- dini_FloatSet(Archivo, "Ratio", 0.0);
- dini_Set(Archivo, "Miembro_1", Nickname[playerid]);
- for(new l = 2; l < 21; l++)
- {
- format(string, sizeof string, "Miembro_%d", l);
- dini_Set(Archivo, string, "<Vacio>");
- }
- format(Archivo, sizeof Archivo, "Jugadores/%s.ini", Nickname[playerid]);
- dini_Set(Archivo, "Clan", Clan_TAG[playerid]);
- file = fopen("Clanes.txt", io_append);
- format(string, sizeof(string), "%s;\r\n", Clan_TAG[playerid]);
- fwrite(file, string);
- fclose(file);
- format(Nick, sizeof Nick, "[%s]%s", Clan_TAG[playerid], Nickname[playerid]);
- SetPlayerName(playerid, Nick);
- SetPlayerColor(playerid, 0);
- EnClan[playerid] = true;
- format(string, sizeof string, "Has creado el clan '%s' TAG: [%s]", tmp3, tmp2);
- SendClientMessage(playerid, LIGHTBLUE, string);
- SendClientMessage(playerid, NARANJA, "Usa /clan color para cambiar el color de tu clan");
- } else {
- SendClientMessage(playerid, ROJO, "El TAG ya está en uso");
- }
- return 1;
- }
- if(!strcmp(tmp, "color", true))
- {
- if(EnClan[playerid] == false) return SendClientMessage(playerid, ROJO, "No tienes clan");
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- if(strcmp(dini_Get(Archivo, "Lider"), Nickname[playerid]) != 0) return SendClientMessage(playerid, ROJO, "Necesitas ser el creador del clan para poder cambiar el color");
- if(CColor[playerid] == true) {
- OcultarCombinador(playerid);
- TogglePlayerControllable(playerid, 1);
- CColor[playerid] = false;
- } else {
- MostrarCombinador(playerid);
- TogglePlayerControllable(playerid, 0);
- COLORES[playerid][3] = 255;
- CColor[playerid] = true;
- SendClientMessage(playerid, NICESKY, "Usa /clan color para cancelar");
- GameTextForPlayer(playerid, "~w~~h~Presiona ~k~~GO_FORWARD~, ~k~~GO_BACK~, ~n~~w~~h~~k~~GO_LEFT~, ~k~~GO_RIGHT~ y ~k~~PED_SPRINT~ ~w~~h~para cambiar el color ~n~~w~~h~y ~k~~PED_FIREWEAPON~ para seleccionar el color", 7000, 3);
- }
- return 1;
- }
- if(!strcmp(tmp, "colorh", true))
- {
- if(EnClan[playerid] == false) return SendClientMessage(playerid, ROJO, "No tienes clan");
- if(strcmp(dini_Get(Archivo, "Lider"), Nickname[playerid]) != 0) return SendClientMessage(playerid, ROJO, "Necesitas ser el creador del clan para poder cambiar el color");
- if(CColor[playerid] == true) return SendClientMessage(playerid, ROJO, "Cierra primero el combinador de colores.");
- tmp2 = strtok(cmdtext, idx);
- longitud = strlen(tmp2);
- if(!longitud) return SendClientMessage(playerid, BLANCO, "Usa: /clan colorh [Código Hexadecimal]");
- if(longitud > 10) return SendClientMessage(playerid, ROJO, "Demasiado grande");
- new
- rojo[3] = "00",
- azul[3] = "00",
- verde[3] = "00",
- alfa[3],
- ColorC;
- if(tmp2[0] == '#')
- {
- format(string, sizeof string, "%s", tmp2[1]);
- if(!IsAHexNumber(string)) return SendClientMessage(playerid, ROJO, "Formato incorrecto. Ejemplo: #FFFFFFFF");
- format(rojo, sizeof rojo, "%c%c", tmp2[1], tmp2[2]);
- format(azul, sizeof azul, "%c%c", tmp2[3], tmp2[4]);
- format(verde, sizeof verde, "%c%c", tmp2[5], tmp2[6]);
- if(tmp2[7] != '\0')
- format(alfa, sizeof alfa, "%c%c", tmp2[7], tmp2[8]);
- else alfa = "FF";
- ColorC = RGBA(HexToInt(rojo), HexToInt(verde), HexToInt(azul), HexToInt(alfa));
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- dini_IntSet(Archivo, "Color", ColorC);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- if(Clan_ID[playerid] == Clan_ID[i])
- SetPlayerColor(i, ColorC);
- }
- format(string, sizeof string, "~y~~h~ Color seleccionado~n~~p~#%s%s%s%s", rojo, verde, azul, alfa);
- GameTextForPlayer(playerid, string, 3000, 4);
- return 1;
- }
- else if(tmp2[0] == '0' && tmp2[1] == 'x')
- {
- format(string, sizeof string, "%s", tmp2[2]);
- if(!IsAHexNumber(string)) return SendClientMessage(playerid, ROJO, "Formato incorrecto. Ejemplo: 0xFFFFFFFF");
- format(rojo, sizeof rojo, "%c%c", tmp2[2], tmp2[3]);
- format(azul, sizeof azul, "%c%c", tmp2[4], tmp2[5]);
- format(verde, sizeof verde, "%c%c", tmp2[6], tmp2[7]);
- if(tmp[8] != '\0')
- format(alfa, sizeof alfa, "%c%c", tmp2[8], tmp2[9]);
- else alfa = "FF";
- ColorC = RGBA(HexToInt(rojo), HexToInt(verde), HexToInt(azul), HexToInt(alfa));
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- dini_IntSet(Archivo, "Color", ColorC);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- if(Clan_ID[playerid] == Clan_ID[i])
- SetPlayerColor(i, ColorC);
- }
- format(string, sizeof string, "~y~~h~ Color seleccionado~n~~p~0x%s%s%s%s", rojo, verde, azul, alfa);
- GameTextForPlayer(playerid, string, 3000, 4);
- return 1;
- }
- if(IsAHexNumber(tmp2))
- {
- format(rojo, sizeof rojo, "%c%c", tmp2[0], tmp2[1]);
- format(azul, sizeof azul, "%c%c", tmp2[2], tmp2[3]);
- format(verde, sizeof verde, "%c%c", tmp2[4], tmp2[5]);
- if(tmp[6] != '\0')
- format(alfa, sizeof alfa, "%c%c", tmp2[6], tmp2[7]);
- else alfa = "FF";
- ColorC = RGBA(HexToInt(rojo), HexToInt(verde), HexToInt(azul), HexToInt(alfa));
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- dini_IntSet(Archivo, "Color", ColorC);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- if(Clan_ID[playerid] == Clan_ID[i])
- SetPlayerColor(i, ColorC);
- }
- format(string, sizeof string, "~y~~h~ Color seleccionado~n~~p~%s%s%s%s", rojo, verde, azul, alfa);
- GameTextForPlayer(playerid, string, 3000, 4);
- return 1;
- } else return SendClientMessage(playerid, ROJO, "Formato incorrecto. Ejemplo: FFFFFFFF");
- }
- if(!strcmp(tmp, "invitar", true))
- {
- if(EnClan[playerid] == false) return SendClientMessage(playerid, ROJO, "No tienes clan");
- if(!strlen(tmp2)) return SendClientMessage(playerid, BLANCO, "Usa: /clan invitar [id]");
- tmp2 = strtok(cmdtext, idx);
- id = strval(tmp2);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, ROJO, "Jugador no conectado");
- if(Ingresado[id] == false) return SendClientMessage(playerid, ROJO, "El jugador invitado necesita estar logueado");
- if(id == playerid) return SendClientMessage(playerid, ROJO, "No puedes enviarte invitación a ti mismo");
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- if(strcmp(dini_Get(Archivo, "Lider"), Nickname[playerid]) != 0) return SendClientMessage(playerid, ROJO, "Necesitas ser el creador del clan para poder invitar");
- if(EnClan[id] == true) return SendClientMessage(playerid, ROJO, "Ese jugador ya tiene clan");
- format(string, sizeof string, "* %s te ha invitado al clan '%s'", Nickname[playerid], dini_Get(Archivo, "Nombre"));
- SendClientMessage(id, LIGHTBLUE, string);
- SendClientMessage(id, NARANJA, "Usa /clan entrar para aceptar la invitación o /clan rechazar para rechazar la invitación.");
- format(string, sizeof string, "* Has invitado a %s ", Nickname[id]);
- SendClientMessage(playerid, LIGHTBLUE, string);
- format(Invitacion[id], 4, "%s", Clan_TAG[playerid]);
- return 1;
- }
- if(!strcmp(tmp, "rechazar", true))
- {
- if(!strlen(Invitacion[playerid])) return SendClientMessage(playerid, ROJO, "No te han invitado a ningun clan");
- Invitacion[playerid][0] = 0;
- return 1;
- }
- if(!strcmp(tmp, "entrar", true))
- {
- if(!strlen(Invitacion[playerid])) return SendClientMessage(playerid, ROJO, "No te han invitado a ningun clan");
- if(EnClan[playerid] == true) return SendClientMessage(playerid, ROJO, "Ya tienes clan");
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Invitacion[playerid]);
- if(dini_Exists(Archivo))
- {
- new
- IDMiembro = 2;
- if(dini_Int(Archivo, "Miembros") == 20) return SendClientMessage(playerid, ROJO, "El clan está lleno");
- dini_IntSet(Archivo, "Miembros", dini_Int(Archivo, "Miembros")+1);
- while(IDMiembro < 20)
- {
- format(string, sizeof string, "Miembro_%d", IDMiembro);
- if(!strcmp(dini_Get(Archivo, string), "<Vacio>"))
- {
- dini_Set(Archivo, string, Nickname[playerid]);
- break;
- }
- IDMiembro++;
- }
- format(Clan_TAG[playerid], 4, Invitacion[playerid]);
- format(Archivo, sizeof Archivo, "Jugadores/%s.ini", Nickname[playerid]);
- dini_Set(Archivo, "Clan", Clan_TAG[playerid]);
- format(Nick, sizeof Nick, "[%s]%s", Clan_TAG[playerid], Nickname[playerid]);
- SetPlayerName(playerid, Nick);
- SetPlayerColor(playerid, dini_Int(Archivo, "Color"));
- format(string, sizeof string, "* %s has entrado al clan '%s'", dini_Get(Archivo, "Nombre"));
- SendClientMessage(playerid, BLANCO, string);
- Clan_ID[playerid] = dini_Int(Archivo, "ID");
- format(string, sizeof string, "* %s ha entrado al clan ", Nickname[playerid]);
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if(i == playerid || !IsPlayerConnected(i)) continue;
- if(Clan_ID[playerid] == Clan_ID[i]) SendClientMessage(i, BLANCO, string);
- }
- EnClan[playerid] = true;
- } else return SendClientMessage(playerid, ROJO, "Ya no existe ese clan");
- return 1;
- }
- if(!strcmp(tmp, "salir", true))
- {
- if(EnClan[playerid] == false) return SendClientMessage(playerid, ROJO, "No tienes clan");
- format(string, sizeof string, "* %s ha salido del clan", Nickname[playerid]);
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if(i == playerid || !IsPlayerConnected(i)) continue;
- if(Clan_ID[playerid] == Clan_ID[i]) SendClientMessage(i, BLANCO, string);
- }
- Clan_ID[playerid] = 0;
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- file = fopen(Archivo, io_read);
- while(fread(file, string))
- {
- idx = strfind(string, Nickname[playerid], true);
- if(idx != -1)
- {
- strmid(string, string, 0, idx-1, 16);
- dini_Set(Archivo, string, "<Vacio>");
- }
- }
- fclose(file);
- dini_IntSet(Archivo, "Miembros", dini_Int(Archivo, "Miembros")-1);
- format(string, sizeof string, "* Saliste del clan '%s'", dini_Get(Archivo, "Nombre"));
- SendClientMessage(playerid, ROJO, string);
- format(Archivo, sizeof Archivo, "Jugadores/%s.ini", Nickname[playerid]);
- dini_Set(Archivo, "Clan", "<Ninguno>");
- SetPlayerName(playerid, Nickname[playerid]);
- SetPlayerColor(playerid, PlayerColors[playerid]);
- EnClan[playerid] = false;
- return 1;
- }
- if(!strcmp(tmp, "expulsar", true))
- {
- if(EnClan[playerid] == false) return SendClientMessage(playerid, ROJO, "No tienes clan");
- tmp2 = strtok(cmdtext, idx);
- if(!strlen(tmp2)) return SendClientMessage(playerid, BLANCO, "Usa: /clan expulsar [id]");
- id = strval(tmp2);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, ROJO, "Jugador no conectado");
- if(id == playerid) return SendClientMessage(playerid, ROJO, "No puedes expulsarte a ti mismo");
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- if(Clan_ID[playerid] != Clan_ID[id]) return SendClientMessage(playerid, ROJO, "Ese jugador no está en tu clan");
- if(strcmp(dini_Get(Archivo, "Lider"), Nickname[playerid]) != 0) return SendClientMessage(playerid, ROJO, "Necesitas ser el creador del clan para poder expulsar");
- OnPlayerCommandText(playerid, "/clan salir");
- SendClientMessage(playerid, ROJO, "Fuiste expulsado del clan");
- return 1;
- }
- if(!strcmp(tmp, "info", true))
- {
- tmp2 = strtok(cmdtext, idx);
- if(!strlen(tmp2)) return SendClientMessage(playerid, BLANCO, "Usa: /clan info [TAG]");
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", tmp2);
- if(dini_Exists(Archivo))
- {
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "> ID: %d\n", dini_Int(Archivo, "ID"));
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Color: %d\n", DLG_INFO_CLAN_STR, dini_Int(Archivo, "Color"));
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Líder: %s\n", DLG_INFO_CLAN_STR, dini_Get(Archivo, "Lider"));
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Miembros: %d\n", DLG_INFO_CLAN_STR, dini_Int(Archivo, "Miembros"));
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Asesinatos: %d\n", DLG_INFO_CLAN_STR, dini_Int(Archivo, "Asesinatos"));
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Muertes: %d\n", DLG_INFO_CLAN_STR, dini_Int(Archivo, "Muertes"));
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Ratio: %0.0f\n", DLG_INFO_CLAN_STR, dini_Float(Archivo, "Ratio"));
- for(new d = 1; d < 21; d++)
- {
- format(string, sizeof string, "Miembro_%d", d);
- format(DLG_INFO_CLAN_STR, sizeof DLG_INFO_CLAN_STR, "%s> Miembro %d: %s\n", DLG_INFO_CLAN_STR, d, dini_Get(Archivo, string));
- }
- format(string, sizeof string, "Información '%s' [%s]", dini_Get(Archivo, "Nombre"), dini_Get(Archivo, "TAG"));
- ShowPlayerDialog(playerid, DLG_CLAN_INFO, DIALOG_STYLE_MSGBOX, string, DLG_INFO_CLAN_STR, "Aceptar", "Cancelar");
- } else return SendClientMessage(playerid, ROJO, "No existe ese clan");
- return 1;
- }
- return 1;
- }
- if(strcmp(cmdtext,"/saltarbici",true)==0)
- {
- if(SaltosBici[playerid] > 0)
- {
- SaltosBici[playerid] = 0;
- SendClientMessage(playerid,Amarillo,"Super saltos en bici desactivado.");
- }
- else
- {
- SaltosBici[playerid] = 1;
- SendClientMessage(playerid,Amarillo,"Super saltos en bici activado. Usa /saltarbici para desactivarlo.");
- }
- return 1;
- }
- //======= Comandos DCMD: =======
- dcmd(acmds, 5, cmdtext);
- dcmd(kill , 4,cmdtext);
- dcmd(reportar , 8,cmdtext);
- dcmd(admins, 6, cmdtext);
- dcmd(conteo, 6, cmdtext);
- dcmd(armas, 5, cmdtext);
- dcmd(anuncio, 7, cmdtext);
- dcmd(fix, 3, cmdtext);
- dcmd(ir, 2, cmdtext);
- dcmd(traer, 5, cmdtext);
- dcmd(sayon, 5, cmdtext);
- dcmd(sayoff, 6, cmdtext);
- dcmd(carcel, 6, cmdtext);
- dcmd(liberar, 7 ,cmdtext);
- dcmd(congelar, 8, cmdtext);
- dcmd(descongelar, 11, cmdtext);
- dcmd(kick, 4, cmdtext);
- dcmd(ban, 3, cmdtext);
- dcmd(Nivel, 5, cmdtext);
- return 0;
- }
- //===================== Comandos DCMD para Administradores =====================
- dcmd_conteo(playerid,params[])
- {
- #pragma unused params
- if (Conteo == 1) return SendClientMessage(playerid, Rojo, "Ya hay un Conteo en Progreso.");
- new nombre[MAX_PLAYER_NAME], string[100];
- GetPlayerName(playerid, nombre, sizeof(nombre));
- format(string, sizeof(string), "* %s ha iniciado un conteo.", nombre);
- Conteo = 1;
- SetTimerEx("Conteo5", 500, false, "d", playerid);
- SendClientMessageToAll(Verde, string);
- return 1;
- }
- //=========----------------------=========//
- dcmd_acmds(playerid,params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][Nivel] == 1)
- {
- SendClientMessage(playerid, Verde, "Comandos de administrador:");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 1: /sayon /sayoff ");
- }
- else if(PlayerInfo[playerid][Nivel] == 2)
- {
- SendClientMessage(playerid, Verde, "Comandos de administrador:");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 1: /sayon /sayoff");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 2: /anuncio - /fix /kick");
- }
- else if(PlayerInfo[playerid][Nivel] == 3)
- {
- SendClientMessage(playerid, Verde, "Comandos de administrador:");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 1: /sayon /sayoff");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 2: /anuncio - /fix /kick");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 3: /armas /traer /ban");
- }
- else if(PlayerInfo[playerid][Nivel] == 4)
- {
- SendClientMessage(playerid, Verde, "Comandos de administrador:");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 1: /sayon /sayoff");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 2:/anuncio /fix /kick");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 3: /armas /traer /ban");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 4: /ir /carcel /liberar ");
- }
- else if(PlayerInfo[playerid][Nivel] == 5)
- {
- SendClientMessage(playerid, Verde, "Comandos de administrador:");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 1: /sayon /sayoff");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 2: /anuncio - /fix /kick");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 3: /armas /traer /ban");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 4: /ir /carcel /liberar");
- SendClientMessage(playerid, Azul, "[Admin]Nivel 5: /nivel /congelar /descongelar");
- }
- else return SendClientMessage(playerid, Rojo, "[[Info]] Lo sentimos no eres Admin");
- return 1;
- }
- dcmd_kill(playerid,params[])
- {
- #pragma unused params
- SendClientMessage(playerid,Rojo,"Por que mierda te matas acaso estas loco o.O");
- SetPlayerHealth(playerid, 0.0);
- return 1;
- }
- dcmd_reportar(playerid,params[])
- {
- #pragma unused params
- new razon[250], string[250], giveplayerid, giveplayer[MAX_PLAYER_NAME], idx, cmd[256];
- cmd = strtok(params, idx);
- if(!strlen(cmd))
- {
- SendClientMessage(playerid, Naranja, "Usa: /reportar [ID] [Razon]");
- return 1;
- }
- giveplayerid = strval(cmd);
- razon = strrest(params,idx);
- if(!strlen(razon))
- {
- SendClientMessage(playerid,Naranja,"Usa: /reportar [ID] [Razon]");
- return 1;
- }
- if (IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessage(playerid,Amarillo,"[[Info]]Tu reporte ha sido enviado con Exito a los Administradores en Linea.");
- SendClientMessage(playerid,Amarillo,"[[Info]]No repitas el reporte o seras castigado.");
- SendClientMessage(playerid,Amarillo,"[[Info]]Si reportaste al ID incorrecto Avisa.");
- format(string,sizeof(string),"* [Reporte:] %s [ID: %d] reportó a %s [ID: %d]. Razón: %s",sendername,playerid,giveplayer,giveplayerid,razon);
- MsgAdmins(Azul,string,1);
- } else {
- format(string, sizeof(string), "[[Info]] Jugador no Conectado");
- SendClientMessage(playerid, Rojo, string);
- }
- return 1;
- }
- dcmd_admins(playerid,params[])
- {
- #pragma unused params
- new Count,i,name[24],string[256];
- for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Nivel] >= 3) Count++;
- if(!Count) return SendClientMessage(playerid, Rojo, "No hay Administradores conectados..");
- if(Count == 1)
- {
- for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Nivel] >= 3) break;
- GetPlayerName(i,name,24); format(string,256,"%s (Nivel: %d)",name,PlayerInfo[i][Nivel]);
- return ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Administradores conectados", string, " Ok ", " Salir ");
- }
- if(Count >= 1)
- {
- new bool:First = false;
- for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Nivel] >= 3)
- {
- GetPlayerName(i,name,24);
- if(!First)
- {
- format(string,256,"%s (Nivel: %d)\n",name,PlayerInfo[i][Nivel]); First = true;
- }
- else format(string,256,"%s %s (Nivel: %d)",string,name,PlayerInfo[i][Nivel]);
- }
- return ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Administradores conectados", string, " Ok ", " Salir ");
- }
- return 1;
- }
- dcmd_armas(playerid,params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][Nivel] >= 3)
- {
- if(IsPlayerInAnyVehicle(playerid)) {
- TogglePlayerControllable(playerid,false); return ShowMenuForPlayer(armas,playerid);
- } else return ShowMenuForPlayer(armas,playerid);
- } else return SendClientMessage(playerid,Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- dcmd_anuncio(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 2)
- {
- new texto;
- if(sscanf(params, "pz", texto))
- {
- SendClientMessage(playerid, Naranja, "Usa: /anuncio <Texto>");
- }
- else
- {
- GameTextForAll(params ,4000, 6);
- }
- } else {
- SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- return 1;
- }
- dcmd_fix(playerid,params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][Nivel] > 2)
- {
- if (IsPlayerInAnyVehicle(playerid)) {
- SetVehicleHealth(GetPlayerVehicleID(playerid),1250.0);
- return SendClientMessage(playerid,Azul,"[[Info:]]> Vehículo Reparado Correctamente.");
- } else return SendClientMessage(playerid,Rojo,"[[Info]] No estas en un vehiculo.");
- } else return SendClientMessage(playerid,Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- dcmd_ir(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 4)
- {
- if(!strlen(params)) return SendClientMessage(playerid, Naranja,"Usa: /ir <ID>");
- new Nick, string[128];
- Nick = strval(params);
- if(IsPlayerConnected(Nick) && Nick != INVALID_PLAYER_ID && Nick != playerid)
- {
- new Float:x, Float:y, Float:z; GetPlayerPos(Nick,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(Nick));
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(Nick));
- if(GetPlayerState(playerid) == 2)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),x+5,y,z); LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(Nick));
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(Nick));
- } else SetPlayerPos(playerid,x+2,y,z);
- format(string,sizeof(string),"Has sido teletransportado hasta %s.",Nick);
- return SendClientMessage(playerid, Azul,string);
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- } else return SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- //=========----------------------=========//
- dcmd_traer(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 3)
- {
- if(!strlen(params)) return SendClientMessage(playerid, Azul, "Usa: /Traer <ID>");
- new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
- player1 = strval(params);
- if(PlayerInfo[player1][Nivel] && PlayerInfo[playerid][Nivel]) return SendClientMessage(playerid, Rojo,"ERROR: No puedes usar este comando sobre este Administrador.");
- if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
- {
- new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(player1,GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(player1,GetPlayerVirtualWorld(playerid));
- if(GetPlayerState(player1) == 2)
- {
- new VehicleID = GetPlayerVehicleID(player1);
- SetVehiclePos(VehicleID,x+3,y,z); LinkVehicleToInterior(VehicleID,GetPlayerInterior(playerid));
- SetVehicleVirtualWorld(GetPlayerVehicleID(player1),GetPlayerVirtualWorld(playerid));
- } else SetPlayerPos(player1,x+2,y,z);
- GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
- format(string,sizeof(string),"Has sido teletransportado por el administrador %s hacia su posición.",adminname); SendClientMessage(player1,Azul,string);
- format(string,sizeof(string),"Has teletransportado a %s hacia tu posición.", playername); return SendClientMessage(playerid,Amarillo,string);
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- } else return SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- //=========----------------------=========//
- dcmd_carcel(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 4)
- {
- new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
- if(!strlen(params)) return SendClientMessage(playerid, Amarillo, "* Usa: /carcel <ID> <Tiempo> <Razón>");
- new player1, Nombreplayerid[MAX_PLAYER_NAME], Adminnombre[MAX_PLAYER_NAME], string[128];
- player1 = strval(tmp);
- if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
- {
- if(PlayerInfo[player1][Carcel] == 0)
- {
- GetPlayerName(player1, Nombreplayerid, sizeof(Nombreplayerid)); GetPlayerName(playerid, Adminnombre, sizeof(Adminnombre));
- new Ctiempo = strval(tmp2);
- if(Ctiempo == 0) Ctiempo = 9999;
- PlayerInfo[player1][CarcelTiempo] = Ctiempo*1000*60;
- SetTimerEx("playeridCarcel",5000,0,"d",player1);
- SetTimerEx("Carcel1",1000,0,"d",player1);
- PlayerInfo[player1][Carcel] = 1;
- if(Ctiempo == 9999)
- {
- if(!strlen(params[strlen(tmp2)+1])) format(string,sizeof(string),"Administrador %s ha encarcelado a %s ",Adminnombre, Nombreplayerid);
- else format(string,sizeof(string),"Administrador %s ha encarcelado a %s | Razón %s",Adminnombre, Nombreplayerid, params[strlen(tmp)+1] );
- } else {
- if(!strlen(tmp3)) format(string,sizeof(string),"Administrador %s ha encarcelado a %s durante %d minutos", Adminnombre, Nombreplayerid, Ctiempo);
- else format(string,sizeof(string),"Administrador %s ha encarcelado a %s durante %d minutos | Razón: %s", Adminnombre, Nombreplayerid, Ctiempo, params[strlen(tmp2)+strlen(tmp)+1] );
- }
- return SendClientMessageToAll(Rojo,string);
- } else return SendClientMessage(playerid, Rojo, "[[Info]]Jugador ya en Carcel.");
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado.");
- } else return SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin.");
- }
- //=========----------------------=========//
- dcmd_liberar(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 4)
- {
- new tmp[256], Index; tmp = strtok(params,Index);
- if(!strlen(params)) return SendClientMessage(playerid, Rojo, "Usa: /Desencarcelar <ID>");
- new player1, Nombreplayerid[MAX_PLAYER_NAME], Adminnombre[MAX_PLAYER_NAME], string[128];
- player1 = strval(tmp);
- if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
- {
- if(PlayerInfo[player1][Carcel] == 1)
- {
- GetPlayerName(player1, Nombreplayerid, sizeof(Nombreplayerid)); GetPlayerName(playerid, Adminnombre, sizeof(Adminnombre));
- format(string,sizeof(string),"El Administrador %s te ha desencarcelado.", Adminnombre); SendClientMessage(player1,Naranja,string);
- format(string,sizeof(string),"Administrador %s ha desencarcelado a %s",Adminnombre, Nombreplayerid);
- SacarCarcel(player1);
- return SendClientMessageToAll(Rojo,string);
- } else return SendClientMessage(playerid, Rojo, "[[Info]]Jugador no en carcel.");
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado.");
- } else return SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- dcmd_congelar(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 5)
- {
- new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
- if(!strlen(params)) return SendClientMessage(playerid, Naranja, "Usa: /Congelar <ID> <Minutos> <Razón>");
- new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
- player1 = strval(tmp);
- if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
- {
- if(PlayerInfo[player1][Congelado] == 0)
- {
- GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
- new Ctiempo = strval(tmp2);
- if(Ctiempo == 0) Ctiempo = 9999;
- TogglePlayerControllable(player1,false); PlayerInfo[player1][Congelado] = 1; PlayerPlaySound(player1,1057,0.0,0.0,0.0);
- PlayerInfo[player1][CongelarTiempo] = Ctiempo*1000*60;
- CongelarTimer[player1] = SetTimerEx("Descongelame",PlayerInfo[player1][CongelarTiempo],0,"d",player1);
- if(Ctiempo == 9999)
- {
- if(!strlen(params[strlen(tmp2)+1])) format(string,sizeof(string),"[Admin] %s ha congelado a %s ",adminname, playername);
- else format(string,sizeof(string),"[Admin] %s ha congelado a %s | Razón %s",adminname, playername, params[strlen(tmp)+1] );
- } else {
- if(!strlen(tmp3)) format(string,sizeof(string),"[Admin] %s ha congelado a %s durante %d minutos.",adminname, playername, Ctiempo);
- else format(string,sizeof(string),"[Admin] %s ha congelado a %s durante %d minutos | Razón: %s",adminname, playername, Ctiempo, params[strlen(tmp2)+strlen(tmp)+1] );
- }
- return SendClientMessageToAll(Amarillo,string);
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador ya Congelado");
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- } else return SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- //=========----------------------=========//
- dcmd_descongelar(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 5)
- {
- if(!strlen(params)) return SendClientMessage(playerid, Naranja, "Usa: /Descongelar <ID>");
- new player1, string[128];
- player1 = strval(params);
- if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
- {
- if(PlayerInfo[player1][Congelado] == 1)
- {
- Descongelame(player1);
- format(string,sizeof(string)," [[Info]] [Admin] %s te ha descongelado.",playerid); SendClientMessage(player1, Naranja,string);
- format(string,sizeof(string),"[[Info]] [Admin] %s ha descongelado a %s", playerid, player1);
- return SendClientMessageToAll(Amarillo,string);
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Congelado");
- } else return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- } else return SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- dcmd_kick(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 2)
- {
- new id;
- new razon;
- if(sscanf(params, "uz", id, razon))
- {
- SendClientMessage(playerid, Naranja, "Usa: /Kick <ID> <Razón>");
- }
- else if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- else
- {
- new string[256],Nombre[24],ANombre[24]; GetPlayerName(playerid,Nombre,24); GetPlayerName(id,ANombre,24);
- format(string,256,"[[Info]] %s ha sido kickeado por un Admin | [Razón: %s].",Nombre,razon);
- SendClientMessageToAll(Amarillo,string);
- Kick(playerid);
- }
- } else {
- SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- return 1;
- }
- dcmd_ban(playerid,params[])
- {
- if(PlayerInfo[playerid][Nivel] >= 4)
- {
- new id;
- new razon;
- if(sscanf(params, "uz", id, razon))
- {
- SendClientMessage(playerid, Naranja, "Usa: /Ban <ID> <Razón>");
- }
- else if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- else
- {
- new string[256],Nombre[24],ANombre[24]; GetPlayerName(playerid,Nombre,24); GetPlayerName(id,ANombre,24);
- format(string,256,"[[Info]] %s ha sido Baneado por un Admin | [Razón: %s].",Nombre,razon);
- SendClientMessageToAll(Amarillo,string);
- Ban(playerid);
- }
- } else {
- SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- return 1;
- }
- //=========----------------------=========//
- dcmd_sayon(playerid, params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][Nivel] >= 1)
- {
- PlayerInfo[playerid][Tsay] = 1;
- SendClientMessage(playerid, Verde, "Comando /Say activado.");
- } else {
- SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin");
- }
- return 1;
- }
- //=========----------------------=========//
- dcmd_sayoff(playerid, params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][Nivel] >= 1)
- {
- PlayerInfo[playerid][Tsay] = 0;
- SendClientMessage(playerid, Rojo, "Comando /Say desactivado.");
- } else {
- SendClientMessage(playerid, Rojo,"[[Info]] Lo sentimos no eres Admin.");
- }
- return 1;
- }
- dcmd_Nivel(playerid, params[])
- {
- if(PlayerInfo[playerid][Nivel] < 5) return SendClientMessage(playerid, Rojo, "[[Info]] Lo sentimos no eres Admin");
- new id, nivel, string[72];
- if(sscanf(params, "ud", id, nivel)) return SendClientMessage(playerid, Naranja, "Uso: /Nivel [id][Nivel]");
- else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Rojo, "[[Info]] Jugador no Conectado");
- else if(playerid == id) return SendClientMessage(playerid, Rojo, "[[Info]] No puedes cambiar tu propio Nivel!");
- else if(nivel < 1 || nivel > 5) return SendClientMessage(playerid, Rojo, "[[Info]] El Nivel tiene qe ser de 1 a 5");
- else if(PlayerInfo[id][Nivel] >= PlayerInfo[playerid][Nivel]) return SendClientMessage(playerid, Rojo, "[[Info]]No puedes modificar a este jugador");
- new
- Name[24];
- PlayerInfo[playerid][Nivel] = nivel;
- GetPlayerName(playerid, Name, 24);
- format(string, sizeof(string), "[Admin] %s Te puso [Admin] Nivel: %d!", Name, nivel);
- SendClientMessage(id, Amarillo, string);
- GetPlayerName(id, Name, 24);
- format(string, sizeof(string), "Le has dado a %s, [Admin] Nivel: %d!", Name, nivel);
- SendClientMessage(playerid, Azul, string);
- return 1;
- }
- //============================================================================//
- public OnPlayerUpdate(playerid)
- {
- if(CColor[playerid] == true)
- {
- new
- keys,
- updown,
- leftright,
- Archivo[64];
- GetPlayerKeys(playerid, keys, updown, leftright);
- if(updown < 0) CSelec[playerid]--;//ARRIBA
- else if(updown > 0) CSelec[playerid]++;//ABAJO
- if(CSelec[playerid] > 4) CSelec[playerid] = 1;
- else if(CSelec[playerid] < 1) CSelec[playerid] = 4;
- if(keys & KEY_FIRE)
- {
- new
- ColorC = RGBA(COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", Clan_TAG[playerid]);
- dini_IntSet(Archivo, "Color", ColorC);
- CColor[playerid] = false;
- COLORES[playerid][0] = 0;//ROJO
- COLORES[playerid][1] = 0;//VERDE
- COLORES[playerid][2] = 0;//AZUL
- COLORES[playerid][3] = 255;//ALPHA
- SetTimerEx("OcultarCombinador", 500, 0, "i", playerid);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- if(Clan_ID[playerid] == Clan_ID[i])
- SetPlayerColor(i, ColorC);
- }
- TogglePlayerControllable(playerid, 1);
- GameTextForPlayer(playerid, "~y~~h~ Color seleccionado", 3000, 4);
- }
- if(leftright > 0)//DERECHA
- {
- if(CSelec[playerid] == 1)//ROJO
- {
- if(keys & KEY_SPRINT) COLORES[playerid][0] += 5;
- else COLORES[playerid][0]++;
- if(COLORES[playerid][0] > 255) COLORES[playerid][0] = 0;
- }
- if(CSelec[playerid] == 2)//VERDE
- {
- if(keys & KEY_SPRINT) COLORES[playerid][1] += 5;
- else COLORES[playerid][1]++;
- if(COLORES[playerid][1] > 255) COLORES[playerid][1] = 0;
- }
- if(CSelec[playerid] == 3)//AZUL
- {
- if(keys & KEY_SPRINT) COLORES[playerid][2] += 5;
- else COLORES[playerid][2]++;
- if(COLORES[playerid][2] > 255) COLORES[playerid][2] = 0;
- }
- if(CSelec[playerid] == 4)//ALPHA
- {
- if(keys & KEY_SPRINT) COLORES[playerid][3] += 5;
- else COLORES[playerid][3]++;
- if(COLORES[playerid][3] > 255) COLORES[playerid][3] = 0;
- }
- }
- if(leftright < 0)//IZQUIERDA
- {
- if(CSelec[playerid] == 1)//ROJO
- {
- if(keys & KEY_SPRINT) COLORES[playerid][0] -= 5;
- else COLORES[playerid][0]--;
- if(COLORES[playerid][0] < 0) COLORES[playerid][0] = 255;
- }
- if(CSelec[playerid] == 2)//VERDE
- {
- if(keys & KEY_SPRINT) COLORES[playerid][1] -= 5;
- else COLORES[playerid][1]--;
- if(COLORES[playerid][1] < 0) COLORES[playerid][1] = 255;
- }
- if(CSelec[playerid] == 3)//AZUL
- {
- if(keys & KEY_SPRINT) COLORES[playerid][2] -= 5;
- else COLORES[playerid][2]--;
- if(COLORES[playerid][2] < 0) COLORES[playerid][2] = 255;
- }
- if(CSelec[playerid] == 4)//ALHPA
- {
- if(keys & KEY_SPRINT) COLORES[playerid][3] -= 5;
- else COLORES[playerid][3]--;
- if(COLORES[playerid][3] < 0) COLORES[playerid][3] = 255;
- }
- }
- ActualizarCombinador(playerid);
- }
- return 1;
- }
- forward ActualizarCombinador(playerid);
- public ActualizarCombinador(playerid)
- {
- new
- str[128],
- ColorS = RGBA(COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- if(CSelec[playerid] == 1) {
- format(str, sizeof str, "~w~>~r~ ROJO ~<~ %03d ~>~ ~n~~g~ VERDE ~<~ %03d ~>~ ~n~~b~ AZUL ~<~ %03d ~>~ ~n~~w~ ALPHA ~<~ %03d ~>~",
- COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- }
- if(CSelec[playerid] == 2) {
- format(str, sizeof str, "~r~ ROJO ~<~ %03d ~>~ ~n~~w~>~g~ VERDE ~<~ %03d ~>~ ~n~~b~ AZUL ~<~ %03d ~>~ ~n~~w~ ALPHA ~<~ %03d ~>~",
- COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- }
- if(CSelec[playerid] == 3) {
- format(str, sizeof str, "~r~ ROJO ~<~ %03d ~>~ ~n~~g~ VERDE ~<~ %03d ~>~ ~n~~w~>~b~ AZUL ~<~ %03d ~>~ ~n~~w~ ALPHA ~<~ %03d ~>~",
- COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- }
- if(CSelec[playerid] == 4) {
- format(str, sizeof str, "~r~ ROJO ~<~ %03d ~>~ ~n~~g~ VERDE ~<~ %03d ~>~ ~n~~b~ AZUL ~<~ %03d ~>~ ~n~~w~>~w~ ALPHA ~<~ %03d ~>~",
- COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- }
- TextDrawSetString(Comb[playerid], str);
- format(str, sizeof str, "~y~0x%x%x%x%x", COLORES[playerid][0], COLORES[playerid][1], COLORES[playerid][2], COLORES[playerid][3]);
- TextDrawSetString(NumColor[playerid], str);
- TextDrawHideForPlayer(playerid, Color[playerid]);
- TextDrawDestroy(Color[playerid]);
- Color[playerid] = TextDrawCreate(9.000000, 255.000000, "CAJA");
- TextDrawBackgroundColor(Color[playerid], 0);
- TextDrawFont(Color[playerid], 1);
- TextDrawLetterSize(Color[playerid], 1.630000, 2.099999);
- TextDrawColor(Color[playerid], 0);
- TextDrawSetProportional(Color[playerid], 1);
- TextDrawUseBox(Color[playerid], 1);
- TextDrawBoxColor(Color[playerid], ColorS);
- TextDrawTextSize(Color[playerid], 153.000000, 0.000000);
- TextDrawShowForPlayer(playerid, Color[playerid]);
- }
- forward MostrarCombinador(playerid);
- public MostrarCombinador(playerid)
- {
- NumColor[playerid] = TextDrawCreate(9.000000, 237.000000, "~y~0x00000000");
- TextDrawBackgroundColor(NumColor[playerid], 255);
- TextDrawFont(NumColor[playerid], 1);
- TextDrawLetterSize(NumColor[playerid], 0.500000, 1.000000);
- TextDrawColor(NumColor[playerid], -1);
- TextDrawSetOutline(NumColor[playerid], 0);
- TextDrawSetProportional(NumColor[playerid], 1);
- TextDrawSetShadow(NumColor[playerid], 1);
- TextDrawUseBox(NumColor[playerid], 1);
- TextDrawBoxColor(NumColor[playerid], 1684300900);
- TextDrawTextSize(NumColor[playerid], 153.000000, 0.000000);
- Color[playerid] = TextDrawCreate(9.000000, 255.000000, "CAJA");
- TextDrawFont(Color[playerid], 1);
- TextDrawLetterSize(Color[playerid], 1.630000, 2.099999);
- TextDrawColor(Color[playerid], 0);
- TextDrawSetProportional(Color[playerid], 1);
- TextDrawUseBox(Color[playerid], 1);
- TextDrawBoxColor(Color[playerid], 0);
- TextDrawTextSize(Color[playerid], 153.000000, 0.000000);
- CComb[playerid] = TextDrawCreate(9.000000, 283.000000, "CAJA");
- TextDrawBackgroundColor(CComb[playerid], 0);
- TextDrawFont(CComb[playerid], 1);
- TextDrawLetterSize(CComb[playerid], 1.630000, 5.100001);
- TextDrawColor(CComb[playerid], 0);
- TextDrawSetOutline(CComb[playerid], 0);
- TextDrawSetProportional(CComb[playerid], 1);
- TextDrawSetShadow(CComb[playerid], 1);
- TextDrawUseBox(CComb[playerid], 1);
- TextDrawBoxColor(CComb[playerid], 1684300900);
- TextDrawTextSize(CComb[playerid], 153.000000, 0.000000);
- Comb[playerid] = TextDrawCreate(9.000000, 280.000000, "~r~ ROJO ~<~ 255 ~>~ ~n~~g~ VERDE ~<~ 255 ~>~ ~n~~b~ AZUL ~<~ 255 ~>~ ~n~~w~ ALPHA ~<~ 255 ~>~");
- TextDrawBackgroundColor(Comb[playerid], 255);
- TextDrawFont(Comb[playerid], 2);
- TextDrawLetterSize(Comb[playerid], 0.400000, 1.400000);
- TextDrawColor(Comb[playerid], -1);
- TextDrawSetOutline(Comb[playerid], 0);
- TextDrawSetProportional(Comb[playerid], 1);
- TextDrawSetShadow(Comb[playerid], 1);
- TextDrawShowForPlayer(playerid, NumColor[playerid]);
- TextDrawShowForPlayer(playerid, Color[playerid]);
- TextDrawShowForPlayer(playerid, CComb[playerid]);
- TextDrawShowForPlayer(playerid, Comb[playerid]);
- }
- forward OcultarCombinador(playerid);
- public OcultarCombinador(playerid)
- {
- TextDrawHideForPlayer(playerid, NumColor[playerid]);
- TextDrawHideForPlayer(playerid, Color[playerid]);
- TextDrawHideForPlayer(playerid, CComb[playerid]);
- TextDrawHideForPlayer(playerid, Comb[playerid]);
- TextDrawDestroy(NumColor[playerid]);
- TextDrawDestroy(Color[playerid]);
- TextDrawDestroy(CComb[playerid]);
- TextDrawDestroy(Comb[playerid]);
- }
- forward ActualizarListaJugadores();
- public ActualizarListaJugadores()
- {
- new
- File:file,
- bool:Existe = false,
- string[128],
- str[32];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(Ingresado[i] == true)
- {
- format(str, sizeof(str), "%s;", Nickname[i]);
- file = fopen("Jugadores.txt", io_read);
- while(fread(file, string))
- {
- if(strfind(string, str, true) == 0)
- {
- Existe = true;
- }
- }
- fclose(file);
- if(Existe == false)
- {
- file = fopen("Jugadores.txt", io_append);
- format(string, sizeof(string), "%s;\r\n", Nickname[i]);
- fwrite(file, string);
- fclose(file);
- }
- }
- }
- Existe = false;
- }
- }
- forward ActualizarTopClanes();
- public ActualizarTopClanes()
- {
- new
- File:file,
- Archivo[64],
- string[128],
- Linea,
- Lugar,
- Float:MAX_VALOR = -1.0;
- file = fopen("Clanes.txt", io_read);
- while(fread(file, string))
- {
- new
- v = strfind(string, ";", true);
- strmid(NOMBRE[Linea], string, 0, v, 32);
- format(Archivo, sizeof(Archivo), "Clanes/%s.ini", NOMBRE[Linea]);
- if(dini_Exists(Archivo))
- {
- VALOR[Linea] = dini_Float(Archivo, "Ratio");
- }
- Linea++;
- }
- fclose(file);
- Lugar = 1;
- while(Lugar < 11)
- {
- for(new i = 0; i < 3000; i++)
- {
- if(EnTop[i] == 0)
- {
- if(VALOR[i] > MAX_VALOR)
- {
- MAX_VALOR = VALOR[i];
- Top[Lugar] = i;
- }
- }
- }
- strmid(TopInfo[Lugar][NickTOP], NOMBRE[Top[Lugar]], 0, 32, 32);
- format(Archivo, sizeof(Archivo), "Clanes/%s.ini", TopInfo[Lugar][NickTOP]);
- TopInfo[Lugar][AsesinatosTOP] = dini_Int(Archivo, "Asesinatos");
- TopInfo[Lugar][MuertesTOP] = dini_Int(Archivo, "Muertes");
- TopInfo[Lugar][RatioTOP] = dini_Float(Archivo, "Ratio");
- EnTop[Top[Lugar]] = 1;
- MAX_VALOR = -1;
- Lugar++;
- }
- for(new s = 0; s < 3000; s++) EnTop[s] = 0;
- format(DLG_TOP_CLAN_STR, sizeof(DLG_TOP_CLAN_STR),"");
- Lugar = 1;
- while(Lugar < 11)
- {
- format(DLG_TOP_CLAN_STR, sizeof(DLG_TOP_CLAN_STR),
- "%s| %02d | %s | Asesinatos: %d | Muertes: %d | Ratio: %0.0f|\n",
- DLG_TOP_CLAN_STR, Lugar, TopInfo[Lugar][NickTOP], TopInfo[Lugar][AsesinatosTOP],
- TopInfo[Lugar][MuertesTOP], TopInfo[Lugar][RatioTOP]);
- Lugar++;
- }
- SetTimer("ActualizarTopClanes", 62000, 0);
- }
- forward ActualizarTopPlayers();
- public ActualizarTopPlayers()
- {
- new
- File:file,
- Archivo[64],
- string[128],
- Linea,
- Lugar,
- Float:MAX_VALOR = -1.0;
- file = fopen("Jugadores.txt", io_read);
- while(fread(file, string))
- {
- new
- v = strfind(string, ";", true);
- strmid(NOMBRE[Linea], string, 0, v, 32);
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", NOMBRE[Linea]);
- if(dini_Exists(Archivo))
- {
- VALOR[Linea] = dini_Float(Archivo, "Ratio");
- }
- Linea++;
- }
- fclose(file);
- Lugar = 1;
- while(Lugar < 11)
- {
- for(new i = 0; i < 3000; i++)
- {
- if(EnTop[i] == 0)
- {
- if(VALOR[i] > MAX_VALOR)
- {
- MAX_VALOR = VALOR[i];
- Top[Lugar] = i;
- }
- }
- }
- strmid(TopInfo[Lugar][NickTOP], NOMBRE[Top[Lugar]], 0, 32, 32);
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", TopInfo[Lugar][NickTOP]);
- TopInfo[Lugar][AsesinatosTOP] = dini_Int(Archivo, "Asesinatos");
- TopInfo[Lugar][MuertesTOP] = dini_Int(Archivo, "Muertes");
- TopInfo[Lugar][RatioTOP] = dini_Float(Archivo, "Ratio");
- EnTop[Top[Lugar]] = 1;
- MAX_VALOR = -1;
- Lugar++;
- }
- for(new s = 0; s < 3000; s++) EnTop[s] = 0;
- format(DLG_TOP_PLY_STR, sizeof(DLG_TOP_PLY_STR),"");
- Lugar = 1;
- while(Lugar < 11)
- {
- format(DLG_TOP_PLY_STR, sizeof(DLG_TOP_PLY_STR),
- "%s| %02d | %s | Asesinatos: %d | Muertes: %d | Ratio: %0.0f|\n",
- DLG_TOP_PLY_STR, Lugar, TopInfo[Lugar][NickTOP], TopInfo[Lugar][AsesinatosTOP],
- TopInfo[Lugar][MuertesTOP], TopInfo[Lugar][RatioTOP]);
- Lugar++;
- }
- SetTimer("ActualizarTopPlayers", 60000, 0);
- SetTimer("ActualizarListaJugadores", 10000, 0);
- }
- stock Registrar(playerid, pass[])
- {
- new
- Archivo[64],
- str[128];
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", NickName(playerid));
- if(!dini_Exists(Archivo))
- {
- dini_Create(Archivo);
- dini_Set(Archivo, "Contrasena", pass);
- dini_IntSet(Archivo, "Asesinatos", 0);
- dini_IntSet(Archivo, "Muertes", 0);
- dini_IntSet(Archivo, "Nivel", 0);
- PlayerInfo[playerid][Nivel] = dini_Int(Archivo, "Nivel");
- dini_FloatSet(Archivo, "Ratio", 0.0);
- dini_Set(Archivo, "Clan", "<Ninguno>");
- format(str, sizeof(str), "Nick '%s' registrado. Contrasena: '%s' ", NickName(playerid), pass);
- SendClientMessage(playerid, NICESKY, str);
- Registrado[playerid] = true;
- SendClientMessage(playerid, NARANJA, "Ahora usa /login [contraseña]");
- }
- }
- stock Login(playerid, pass[])
- {
- new
- Archivo[64],
- Nick[MAX_PLAYER_NAME];
- format(Archivo, sizeof(Archivo), "Jugadores/%s.ini", NickName(playerid));
- if(dini_Exists(Archivo))
- {
- if(!strcmp(dini_Get(Archivo, "Contrasena"), pass, false))
- {
- strmid(Nickname[playerid], NickName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
- PlayerInfo[playerid][Nivel] = dini_Int(Archivo, "Nivel");
- Asesinatos[playerid] = dini_Int(Archivo, "Asesinatos");
- Muertes[playerid] = dini_Int(Archivo, "Muertes");
- Ratio[playerid] = dini_Float(Archivo, "Ratio");
- Ingresado[playerid] = true;
- format(Archivo, sizeof Archivo, "Clanes/%s.ini", dini_Get(Archivo, "Clan"));
- if(dini_Exists(Archivo))
- {
- format(Clan_TAG[playerid], 4, dini_Get(Archivo, "TAG"));
- format(Nick, sizeof Nick, "[%s]%s", Clan_TAG[playerid], NickName(playerid));
- SetPlayerName(playerid, Nick);
- SetPlayerColor(playerid, dini_Int(Archivo, "Color"));
- Clan_ID[playerid] = dini_Int(Archivo, "ID");
- EnClan[playerid] = true;
- }
- SendClientMessage(playerid, NICESKY, "Logueado Correctamente");
- } else SendClientMessage(playerid, ROJO, "Contraseña Incorrecta");
- }
- }
- stock NickName(playerid)
- {
- new
- NickP[MAX_PLAYER_NAME];
- GetPlayerName(playerid, NickP, MAX_PLAYER_NAME);
- return NickP;
- }
- //Por Zamaroht
- stock RGBA(red, green, blue, alpha)
- {
- return (red * 16777216) + (green * 65536) + (blue * 256) + alpha;
- }
- //Por Zoutdaxv
- stock IsAHexNumber(string[])
- {
- new
- longitud = strlen(string);
- for(new s = 0; s < longitud; s++)
- {
- if(string[s] < 48 || string[s] > 57 && string[s] < 65 || string[s] > 70)
- {
- return false;
- }
- }
- return true;
- }
- //Por Dracoblue
- stock HexToInt(string[])
- {
- if(string[0] == 0) return 0;
- new
- i = strlen(string),
- cur = 1,
- res = 0;
- for( ; i > 0; i--)
- {
- if(string[i-1] < 58) res = res + cur * (string[i-1] - 48);
- else res = res + cur * (string[i-1] - 55);
- cur = cur * 16;
- }
- return res;
- }
- stock 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;
- }
- stock strrest(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[24];
- while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- forward MsgAdmins(color,const string[],level);
- public MsgAdmins(color,const string[],level)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (PlayerInfo[i][Nivel] >= level)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- new Menu:current;
- current = GetPlayerMenu(playerid);
- if(current == armas)
- {
- switch(row)
- {
- case 0: { GivePlayerWeapon(playerid,22,800);}
- case 1: { GivePlayerWeapon(playerid,28,800);}
- case 2: { GivePlayerWeapon(playerid,26,800);}
- case 3: { GivePlayerWeapon(playerid,16,800);}
- case 4: { GivePlayerWeapon(playerid,41,800); SendClientMessage(playerid,Rojo,"No Abuses de Esta Arma");}
- case 5: { GivePlayerWeapon(playerid,37,800); SendClientMessage(playerid,Rojo,"No Abuses de Esta Arma");}
- case 6: { GivePlayerWeapon(playerid,36,800); SendClientMessage(playerid,Rojo,"No Abuses de Esta Arma");}
- case 7: { GivePlayerWeapon(playerid,35,800); SendClientMessage(playerid,Rojo,"No Abuses de Esta Arma");}
- case 8: { GivePlayerWeapon(playerid,38,800); SendClientMessage(playerid,Rojo,"No Abuses de Esta Arma");}
- }
- }
- return 1;
- }
- stock sscanf(string[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(string))
- #else
- if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (string[stringPos] && string[stringPos] <= ' ')
- {
- stringPos++;
- }
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = string[stringPos];
- do
- {
- stringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- setarg(paramPos, 0, _:floatstr(string[stringPos]));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- stringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = stringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = string[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- string[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - stringPos;
- foreach (Player, playerid)
- {
- GetPlayerName(playerid, name, sizeof (name));
- if (!strcmp(name, string[stringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- string[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- stringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
- {
- stringPos++;
- }
- while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
- {
- stringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
- forward Descongelame(player1);
- public Descongelame(player1)
- {
- KillTimer( CongelarTimer[player1] );
- TogglePlayerControllable(player1,true); PlayerInfo[player1][Congelado] = 0;
- PlayerPlaySound(player1,1057,0.0,0.0,0.0); GameTextForPlayer(player1,"~g~Descongelado",3000,3);
- }
- forward SacarCarcel(player1);
- public SacarCarcel(player1)
- {
- KillTimer( CarcelTimer[player1] );
- PlayerInfo[player1][CarcelTiempo] = 0; PlayerInfo[player1][Carcel] = 0;
- SetPlayerInterior(player1,0); SetPlayerPos(player1, 0.0, 0.0, 0.0); SpawnPlayer(player1);
- PlayerPlaySound(player1,1057,0.0,0.0,0.0);
- GameTextForPlayer(player1,"~g~Liberado",3000,3);
- }
- //=========----------------------=========//
- forward Carcel1(player1);
- public Carcel1(player1)
- {
- TogglePlayerControllable(player1,false);
- new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z);
- ResetPlayerWeapons(player1);
- SetPlayerCameraPos(player1,x+10,y,z+10);SetPlayerCameraLookAt(player1,x,y,z);
- SetTimerEx("Carcel2",1000,0,"d",player1);
- }
- //=========----------------------=========//
- forward Carcel2(player1);
- public Carcel2(player1)
- {
- new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z);
- ResetPlayerWeapons(player1);
- SetPlayerCameraPos(player1,x+7,y,z+5); SetPlayerCameraLookAt(player1,x,y,z);
- if(GetPlayerState(player1) == PLAYER_STATE_ONFOOT) SetPlayerSpecialAction(player1,SPECIAL_ACTION_HANDSUP);
- GameTextForPlayer(player1,"~r~Atrapado",3000,3);
- SetTimerEx("Carcel3",1000,0,"d",player1);
- }
- //=========----------------------=========//
- forward Carcel3(player1);
- public Carcel3(player1)
- {
- new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z);
- ResetPlayerWeapons(player1);
- SetPlayerCameraPos(player1,x+3,y,z); SetPlayerCameraLookAt(player1,x,y,z);
- SetTimerEx("CarcelPlayer",1000,0,"d",player1);
- }
- //=========----------------------=========//
- forward CarcelPlayer(player1);
- public CarcelPlayer(player1)
- {
- TogglePlayerControllable(player1,true);
- SetPlayerPos(player1,197.6661,173.8179,1003.0234);
- ResetPlayerWeapons(player1);
- SetPlayerInterior(player1,3);
- SetCameraBehindPlayer(player1);
- CarcelTimer[player1] = SetTimerEx("SacarCarcel",PlayerInfo[player1][CarcelTiempo],0,"d",player1);
- PlayerInfo[player1][Carcel] = 1;
- }
- //=====================[Conteo]=====================//
- forward Conteo5(playerid);
- forward Conteo4(playerid);
- forward Conteo3(playerid);
- forward Conteo2(playerid);
- forward Conteo1(playerid);
- forward ConteoGo(playerid);
- public Conteo5(playerid)
- {
- SetTimerEx("Conteo4", 1000, false, "d", playerid);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- }
- GameTextForAll("~r~5!", 1000, 4);
- return 1;
- }
- public Conteo4(playerid)
- {
- SetTimerEx("Conteo3", 1000, false, "d", playerid);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- }
- GameTextForAll("~g~4!", 1000, 4);
- return 1;
- }
- public Conteo3(playerid)
- {
- SetTimerEx("Conteo2", 1000, false, "d", playerid);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- }
- GameTextForAll("~b~3!", 1000, 4);
- return 1;
- }
- public Conteo2(playerid)
- {
- SetTimerEx("Conteo1", 1000, false, "d", playerid);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- }
- GameTextForAll("~y~2!", 1000, 4);
- return 1;
- }
- public Conteo1(playerid)
- {
- SetTimerEx("ConteoGo", 1000, false, "d", playerid);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- }
- GameTextForAll("~p~1!", 1000, 4);
- return 1;
- }
- public ConteoGo(playerid)
- {
- Conteo = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- }
- GameTextForAll("~g~G~g~o~w~o~r~o~p~!", 1500, 4);
- return 1;
- }
- stock JugadorEnBici(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 481 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 510) return 1;
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if ((oldkeys & (KEY_ACTION | KEY_ACTION)) == (KEY_ACTION | KEY_ACTION))
- {
- if(SaltosBici[playerid] == 1 && JugadorEnBici(playerid))
- {
- new Float:x,Float:y,Float:z;
- GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
- SetTimerEx("SaltosBiciTimer",150,0,"d",playerid);
- SaltosBici[playerid] = 2;
- }
- }
- return 0;
- }
- forward SaltosBiciTimer(playerid);
- public SaltosBiciTimer(playerid)
- {
- if(IsPlayerConnected(playerid) && JugadorEnBici(playerid))
- {
- if(SaltosBici[playerid] == 2)
- {
- new Float:x,Float:y,Float:z;
- GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
- if(z < 0) return SaltosBici[playerid] = 1;
- SetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z+(z*4));
- SetTimerEx("SaltosBiciTimer",4000,0,"d",playerid);
- SaltosBici[playerid] = 3;
- }
- else if(SaltosBici[playerid] == 3) SaltosBici[playerid] = 1;
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_ONFOOT)
- {
- if(SaltosBici[playerid] > 1) SaltosBici[playerid] = 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment