CMD:criarhelper(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] != 1337 && PlayerInfo[playerid][pAdmin] != 3001 && PlayerInfo[playerid][pAdmin] != 5000) { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar este comando!"); return 1; } new para2; new level2; if(sscanf(params, "ud", para2, level2)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /criarhelper [ID do Player] [Nнvel(de 1 a 300)]"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(para2, giveplayer, sizeof(giveplayer)); if(IsPlayerConnected(para2)) { if(para2 != INVALID_PLAYER_ID) { if(!TemVagaHelper() && PlayerInfo[para2][pHelper] < 1)return SendClientMessage(playerid, COLOR_GRAD1, "Sem vagas de helpers, use: /limparhelper para limpar uma vaga!"); new string[200]; format(string, sizeof(string), " Vocк promoveu %s para nнvel %d de Helper.", giveplayer,level2); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " Vocк foi promovido a nнvel %d de Helper, pelo admin %s", level2, sendername); SendClientMessage(para2, COLOR_LIGHTBLUE, string); getdate(year, month, day); gettime(hour,minute,second); format(string, sizeof(string), "%s deu Helper Nнvel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level2, NomePlayer(para2), day, month, year, hour, minute, second); BPFLogs("darhelper", string); PlayerInfo[para2][pHelper] = level2; if(level2 > 0) { SetVagaHelper(NomePlayer(para2), level2); AddHelper(NomePlayer(para2), level2); } else { SetPlayerToTeamColor(para2); SetPlayerHealth(para2, 100); PlayerInfo[para2][pHelper] = 0; helpertrampando[para2] = 0; RemoverHelper(NomePlayer(para2)); RemoveVagaHelper(NomePlayer(para2)); } } } return 1; } stock AddHelper(Nome[], nivel) { new stradmin[50]; format(stradmin, sizeof stradmin, Pasta_Helpers, Nome); if(!DOF2_FileExists(stradmin))DOF2_CreateFile(stradmin); DOF2_SetInt(stradmin, "HelperNivel", nivel); return true; } stock RemoverHelper(Nome[]) { new stradmin[50]; format(stradmin, sizeof stradmin, Pasta_Helpers, Nome); if(DOF2_FileExists(stradmin))DOF2_RemoveFile(stradmin); return true; }
Crie a 'Pasta_Helpers' que estб em RemoverHelper e AddHelper
|
CMD:ban(playerid, params[]) { new result[64]; if(sscanf(params, "us[64]", giveplayerid, result)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [ID do Player] [motivo]"); return true; } new string[128]; if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAdminTemp] >= 1) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(PlayerInfo[giveplayerid][pAdmin] >= 3001) { SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode banir este admin!"); return true; } if(strcmp(NomePlayer(giveplayerid), "BGO_Ajudante", true) == 0) return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode banir o ajudante do server"); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "AdmCmd: %s foi banido pelo ADMIN SECRETO, Motivo: %s", giveplayer, (result)); BPFLogs("kick", string); format(string, sizeof(string), "AdmCmd: %s foi banido pelo ADMIN SECRETO, Motivo: %s", giveplayer, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result)); BPFLogs("ban", string); format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[giveplayerid][pBan] = 1; TextDrawShowForPlayer(giveplayerid, TextBan); SBan(giveplayerid, result, PlayerName(playerid)); PlayerPlaySound(giveplayerid, 31202, 0.0, 0.0, 0.0); return true; } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar este comando!"); } return true; }