25.06.2012, 13:42
TA ai um sistema de helpers desbugado por mim
Qualquer Bug pode comemtar
Qualquer Bug pode comemtar
Код:
//Sistema de helpers e admins || By: 385gtamaster e Besbugado por: rilo_520 #include <a_samp> #include <a_samp> #include <Dini> #include <dudb> #include <utils> #include <morphinc> #include <cpstream> #include <core> #pragma unused ret_memcpy //CORES #define COLOR_HELPER 0x68FFC2AA #define COLOR_WHITE 0xFFFFFFAA //OUTRAS CORES #define COLOR_BLUE 0x004CFFAA #define COLOR_DBLUE 0x0800A8AA #define COLOR_PINK 0xFF48FFAA #define COLOR_PINK1 0xDF00E0AA #define COLOR_GREY 0xC190FFAA #define COLOR_BLACK 0x000000AA #define COLOR_YELLOW 0xE8D000AA #define COLOR_YELLOW1 0xD09C00AA #define COLOR_ORANGE 0xF08400AA #define COLOR_ORANGE1 0xFF2600AA #define COLOR_GREEN 0x18F000AA #define COLOR_GREEN1 0x085800AA #define COLOR_WARNING 0xFF3620AA #define COLOR_LIGHTBLUE 0x18F3FFAA #define COLOR_RED 0xE00000AA #define COLOR_RED1 0x980000AA //HELPER new HelperTrabalhando[MAX_PLAYERS]; //LEVEL enum lInfo { Helper, }; new LevelInfo[MAX_PLAYERS][lInfo]; //OUTROS new nome[MAX_PLAYER_NAME]; forward SendMessageToHelper(color,const string[]); public OnFilterScriptInit() { print("-------------------------------------------------"); print(" Sistema de helpers carregado || By: 385gtamaster e Besbugado por: rilo_520"); print("-------------------------------------------------"); return 1; } public OnFilterScriptExit() { print("----------------------------------------------------"); print(" Sistema de helpers descarregado || By: 385gtamaster e Besbugado por: rilo_520 "); print("----------------------------------------------------"); return 1; } public OnGameModeInit() { return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new idx; new string[256]; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/darhelper", true) == 0) { if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_YELLOW,"Voce Nao e Admin"); if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб conetado!"); new tmp[256]; new NomeDado[256]; new NomeDado1[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /darhelper [id] [Nivel]"); new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /darhelper [id] [Nivel]"); level = strval(tmp); GetPlayerName(para1, NomeDado, sizeof(NomeDado)); GetPlayerName(playerid, NomeDado1, sizeof(NomeDado1)); if(para1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Player nгo conetado!"); format(string, sizeof string, "Vocк deu Helper Nнvel %d para %s", level, NomeDado); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof string, "Vocк ganhou Helper Nнvel %d do admin %s", level, NomeDado1); SendClientMessage(para1, COLOR_LIGHTBLUE, string); LevelInfo[para1][Helper] = level; return 1; } //------------------------------------------- if(strcmp(cmd, "/helper", true) == 0 || strcmp(cmd, "/h", true) == 0) { if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб conetado!"); if(LevelInfo[playerid][Helper] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й um Helper ou nгo tem level suficiente!"); if(HelperTrabalhando[playerid] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб trabalhando (/profhelper)"); GetPlayerName(playerid, nome, sizeof(nome)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USO: /helper [TEXTO]"); return 1; } format(string,sizeof(string),"Helper %s: %s", nome, result); return 1; } //------------------------------------------- if(strcmp(cmd, "/irhelp", true) == 0) { if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб conetado!"); if(LevelInfo[playerid][Helper] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й um Helper ou nгo tem level suficiente!"); if(HelperTrabalhando[playerid] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб trabalhando (/profhelper)"); new tmp[256]; new NomeDestino[256]; new NomeDestinado[256]; new Float:x, Float:y, Float:z; tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USO: /irhelp [playerid]"); if(strval(tmp) == INVALID_PLAYER_ID || !IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid, COLOR_WHITE, "Player nгo conetado!"); GetPlayerName(strval(tmp), NomeDestino, sizeof(NomeDestino)); GetPlayerName(playerid, NomeDestinado, sizeof(NomeDestinado)); new interior = GetPlayerInterior(strval(tmp)); GetPlayerPos(strval(tmp), x, y, z); SetPlayerPos(playerid, x+0.5, y, z); SetPlayerInterior(playerid, interior); format(string,sizeof(string),"HELPER CMD: O Helper %s se teleportou atй vocк!",NomeDestinado); SendClientMessage(playerid, COLOR_YELLOW,string); format(string,sizeof(string),"HELPER CMD: Vocк se teleportou ao player %s",NomeDestino); SendClientMessage(playerid, COLOR_YELLOW,string); return 1; } //------------------------------------------- if(strcmp(cmd, "/trazerhelp", true) == 0) { if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб conetado!"); if(LevelInfo[playerid][Helper] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й um Helper ou nгo tem level suficiente!"); if(HelperTrabalhando[playerid] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб trabalhando (/profhelper)"); new tmp[256]; new NomeDestino[256]; new NomeDestinado[256]; new Float:x, Float:y, Float:z; tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USO: /trazerhelp [playerid]"); if(strval(tmp) == INVALID_PLAYER_ID || !IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid, COLOR_WHITE, "Player nгo conetado!"); GetPlayerName(strval(tmp), NomeDestino, sizeof(NomeDestino)); GetPlayerName(playerid, NomeDestinado, sizeof(NomeDestinado)); new interior = GetPlayerInterior(strval(tmp)); GetPlayerPos(playerid, x, y, z); SetPlayerPos(strval(tmp), x+0.5, y, z); SetPlayerInterior(strval(tmp), interior); format(string,sizeof(string),"HELPER CMD: O Helper %s se trouce vocк atй ele!",NomeDestinado); SendClientMessage(playerid, COLOR_YELLOW,string); format(string,sizeof(string),"HELPER CMD: Vocк trouce %s atй vocк",NomeDestino); SendClientMessage(playerid, COLOR_YELLOW,string); return 1; } //------------------------------------------- if(strcmp(cmd, "/avh", true) == 0 || strcmp(cmd, "/avisohelper", true) == 0) { if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб conetado!"); if(LevelInfo[playerid][Helper] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й um Helper ou nгo tem level suficiente!"); if(HelperTrabalhando[playerid] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб trabalhando (/profhelper)"); GetPlayerName(playerid, nome, sizeof(nome)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USO: /avh [texto]"); return 1; } SendClientMessage(playerid, COLOR_WHITE, "|_________Helper Avisa__________|"); format(string,sizeof(string),"Helper %s: %s",nome, (result)); SendClientMessageToAll(COLOR_HELPER,string); return 1; } //------------------------------------------- if(strcmp(cmd, "/ajudahelper", true) == 0 || strcmp(cmd, "/ah", true) == 0) { if(LevelInfo[playerid][Helper] < 0) return SendClientMessage(playerid, COLOR_WARNING, "Vocк nгo й um Helper!"); if(HelperTrabalhando[playerid] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб trabalhando (/profhelper)"); if(LevelInfo[playerid][Helper] == 1) { SendClientMessage(playerid, COLOR_GREEN, "=&=&=&=&=&=&=&=&=&==Ajuda Helper==&=&=&=&=&=&=&=&=&=&=&"); SendClientMessage(playerid, COLOR_BLUE, "[Helper] /irhelp | /trazerhelp | /profhelper | /avh"); SendClientMessage(playerid, COLOR_BLUE, "[Helper] /helper | /darhelper"); SendClientMessage(playerid, COLOR_GREEN, "=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&=&"); } return 1; } //------------------------------------------- if(strcmp(cmd, "/profhelper", true) == 0) { if(LevelInfo[playerid][Helper] < 0) return SendClientMessage(playerid, COLOR_WARNING, "Vocк nгo й um Helper!"); if(HelperTrabalhando[playerid] == 1) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк entrou em modo de jogo e seus comandos administrativos foram-lhe retirados."); HelperTrabalhando[playerid] = 0; SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 0); return 1; } if(HelperTrabalhando[playerid] == 0) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк entrou em modo de admin e seus comandos administrativos foram-lhe devolvidos."); HelperTrabalhando[playerid] = 1; SetPlayerHealth(playerid, 9999999); SetPlayerArmour(playerid, 9999999); return 1; } return 1; } //------------------------------------------- if(strcmp(cmd, "/duvida", true) == 0) { if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб conetado!"); GetPlayerName(playerid, nome, sizeof(nome)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USO: /duvida [duvida]"); return 1; } format(string,sizeof(string),"Duvida de %s: %s",nome, (result)); SendMessageToHelper(COLOR_YELLOW,string); SendClientMessage(playerid, COLOR_LIGHTBLUE, "Duvida enviada com sucesso!"); return 1; } //------------------------------------------- if(strcmp(cmd, "/helpers", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_HELPER, "Helpers Online:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(HelperTrabalhando[playerid] == 1) { if(LevelInfo[i][Helper] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(string, 256, "Helper: %s || Nivel: [%s] || Modo: [Ajuda]", nome, LevelInfo[playerid][Helper]); SendClientMessage(playerid, COLOR_WHITE, string); } } if(HelperTrabalhando[playerid] == 0) { if(LevelInfo[i][Helper] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(string, 256, "Helper: %s || Nivel: [%s] || Modo: [Jogo]", nome, LevelInfo[playerid][Helper]); SendClientMessage(playerid, COLOR_WHITE, string); } } } } } return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } 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; } public SendMessageToHelper(color,const string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if (LevelInfo[i][Helper] >= 1) { SendClientMessage(i, color, string); } } return 1; }