09.07.2011, 22:48
How do i add save kills and save deaths to my admin script?
Here is my Current Admin Script.
Here is my Current Admin Script.
Код:
#include <a_samp> #include <streamer> #include <dini> #include <dudb> #include <zcmd> #include <sscanf2> #pragma unused ret_memcpy #define COLOR_YELLOW 0xD8D8D8FF #define COLOR_FADE1 0xE6E6E6E6 #define COLOR_FADE2 0xC8C8C8C8 #define COLOR_FADE3 0xAAAAAAAA #define COLOR_FADE4 0x8C8C8C8C #define COLOR_FADE5 0x6E6E6E6E #define red 0xFF0000AA #define COLOR_BLUEMEDIUM 0x0000CDAA #define COLOR_CON_GREEN 0x00FF00FF #define COLOR_BLUEDARK 0x00008BAA #define COLOR_PINK 0xFF1493AA #define COLOR_PINKDARK 0xFF00FFAA #define COLOR_GREEN 0x008000AA #define COLOR_GREENLIGHT 0x00FF00AA #define COLOR_GREENDARK 0x006400AA #define COLOR_MAROON 0x800000AA #define COLOR_OKER 0x808000AA #define COLOR_ORANGE 0xFF4500AA #define COLOR_ORANGELIGHT 0xFF8C00AA #define COLOR_PURPLE 0x800080AA #define COLOR_VIOLETDARK 0x9400D3AA #define COLOR_INDIGO 0xAB0082AA #define COLOR_RED 0xFF0000AA #define COLOR_SAND 0xFFDEADAA #define COLOR_SILVER 0xC0C0C0AA #define COLOR_TEAL 0x008080AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_GOLD 0xFFD700AA #define COLOR_BROWN 0x8B4513AA #define COLOR_BROWNLIGHT 0xA0522DAA #define COLOR_GRAY 0xA9A9A9AA #define COLOR_GRAYDARK 0x696969AA #define COLOUR_YELLOW 0xFFFF00FF #define COLOUR_RED 0xFF3E3EFF #define COLOR_GREY 0xAFAFAFAA #define COLOR_WHITE 0xFFFFFFAA #define BLUE 0x0000FFAA #define PINK 0xFF66FFAA #define BLACK 0x000000AA #define AQUA 0x7CFC00AA #define YELLOW 0xFFFF00AA #define WHITE 0xFFFFFFAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define WHITEP 0xFFFFD5AA #define GREY 0xAFAFAFAA #define CYAN 0x99FFFFAA #define PURPLE 0x9900FFAA #define ADMIN_RED 0xFB0000FF #define RED 0xE60000FF #define ADMIN_RED 0xFB0000FF #define LIGHTRED 0xFF8080FF #define PLAYER_COLOR 0xFFFFFFFF #define LIGHTGREEN 0x38FF06FF #define DARKPINK 0xE100E1FF #define DARKGREEN 0x008040FF #define ANNOUNCEMENT 0x00CACAFB #define AFK 0x6AF7E1FF #define COLOR_SYSTEM 0xEFEFF7AA #define PLAYER_VIEW 0xC0C0C0FF #define COLOR_GRAD1 0xB4B5B7FF #define NICESKY 0x99FFFFAA #define GRAY 0xCECECEFF #define COLOR_BRIGHTRED 0xFF000AAA #define COLOR_AQUA 0x00FFFFAA #define COLOR_GREY 0xAFAFAFAA #define COLOR_BEIGE 0xFFF8DCAA #define COLOR_BLACK 0x000000AA #define COLOR_BLUE 0x0000FFAA #define COLOR_BLUELIGHTER 0x00BFFFAA #define COLOR_BLUELIGHT 0x1E90FFAA #define COLOR_FADE1 0xE6E6E6E6 #define Green 0x45E01FFF #define Red 0xFF0000AA #define ADMINFS_MESSAGE_COLOR 0xFF444499 #define PM_INCOMING_COLOR 0xFFFF22AA #define PM_OUTGOING_COLOR 0xFFCC2299 #define COLOR_FADE2 0xC8C8C8C8 #define LIGHTBLUE 0x00BFFFAA #define COLOR_FADE3 0xAAAAAAAA #define COLOR_FADE4 0x8C8C8C8C #define COLOR_FADE5 0x6E6E6E6E #define red 0xFF0000AA new IsLogged[MAX_PLAYERS]; new file[256]; new Text:godmodeon; new Text:godmodeoff; forward ReportLog(string[]); main() { } enum pInfo { AdminLevel, Cash, Score, Color, Job, Vw, Int, Warns, Fleader, Fmember, Bank, Prods, Skin, RepairOffer, Credit, } new PlayerInfo[MAX_PLAYERS][pInfo]; public ReportLog(string[]) { new entry[128]; format(entry, sizeof(entry), "%s\n",string); new File:hFile; hFile = fopen("HZadmin/Reports/Reports.txt", io_append); fwrite(hFile, entry); fclose(hFile); } public OnFilterScriptInit() { godmodeon = TextDrawCreate(630.000000, 416.000000, "GOD MODE [ON]"); TextDrawAlignment(godmodeon, 3); TextDrawBackgroundColor(godmodeon, 255); TextDrawFont(godmodeon, 1); TextDrawLetterSize(godmodeon, 0.390000, 2.399999); TextDrawColor(godmodeon, -16776961); TextDrawSetOutline(godmodeon, 0); TextDrawSetProportional(godmodeon, 1); TextDrawSetShadow(godmodeon, 1); godmodeoff = TextDrawCreate(635.000000, 416.000000, "GOD MODE [OFF]"); TextDrawAlignment(godmodeoff, 3); TextDrawBackgroundColor(godmodeoff, 255); TextDrawFont(godmodeoff, 1); TextDrawLetterSize(godmodeoff, 0.390000, 2.399999); TextDrawColor(godmodeoff, 16711935); TextDrawSetOutline(godmodeoff, 0); TextDrawSetProportional(godmodeoff, 1); TextDrawSetShadow(godmodeoff, 1); print("\n--------------------------------------"); print(" HayZatic AdminSystem"); print("--------------------------------------\n"); return 1; } public OnGameModeInit() { return 1; } public OnPlayerConnect(playerid) { IsLogged[playerid] = 0; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), "HZadmin/Users/%s.ini", name); if (!dini_Exists(file)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, put your registration password below.", "Register", "Leave"); } if(fexist(file)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "You are registred, put your password below.", "Login", "Leave"); } if(PlayerInfo[playerid][Warns] == 5) { SendClientMessage(playerid, 0xFF00CC, "Your account is blocked for max. warns(5) reached, apply on forums to unblock your account."); Kick(playerid); } } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == 1) { new name[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), "HZadmin/Users/%s.ini", name); if(!response) return Kick(playerid); if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Please Register", "Welcome, You Are Not Registered. Please Register Below.", "Register", "Leave"); dini_Create(file); dini_IntSet(file, "Password", udb_hash(inputtext)); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0); dini_IntSet(file, "Cash",PlayerInfo[playerid][Cash] = 500); dini_IntSet(file, "Score",PlayerInfo[playerid][Score] = 0); dini_IntSet(file, "Job",PlayerInfo[playerid][Job] = 0); dini_IntSet(file, "Color",PlayerInfo[playerid][Color] = 0); dini_IntSet(file, "Vw",PlayerInfo[playerid][Vw] = 0); dini_IntSet(file, "Int",PlayerInfo[playerid][Int] = 0); dini_IntSet(file, "Warns",PlayerInfo[playerid][Warns] = 0); dini_IntSet(file, "Fleader",PlayerInfo[playerid][Fleader] = 0); dini_IntSet(file, "Fmember",PlayerInfo[playerid][Fmember] = 0); dini_IntSet(file, "Bank",PlayerInfo[playerid][Bank] = 0); dini_IntSet(file, "Prods",PlayerInfo[playerid][Prods] = 0); dini_IntSet(file, "Skin",PlayerInfo[playerid][Skin] = 0); dini_IntSet(file, "RepairOffer",PlayerInfo[playerid][RepairOffer] = 0); dini_IntSet(file, "Credit",PlayerInfo[playerid][Credit] = 0); format(string, 128, "[System]:Thank You %s For Registering.Your Password Is %s, Your Are Loged In.", name, inputtext); SendClientMessage(playerid, 0xFF00CC, string); IsLogged[playerid] = 1; } if (dialogid == 2) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), "HZadmin/Users/%s.ini", name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Welcome Back! Please Insert Your Password Below.", "Login", "Leave"); new tmp; tmp = dini_Int(file, "Password"); if(udb_hash(inputtext) != tmp) { SendClientMessage(playerid, 0xFF00CC, "You Have Inserted A Invalid Password!."); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Welcome Back! Please Insert Your Password Below.", "Login", "Leave"); } else { IsLogged[playerid] = 1; SetPlayerMoney(playerid, dini_Int(file, "Cash")); SetPlayerScore(playerid, dini_Int(file, "Score")); SetPlayerVirtualWorld(playerid, dini_Int(file, "Vw")); SetPlayerInterior(playerid, dini_Int(file, "Int")); PlayerInfo[playerid][Job] = dini_Int(file, "Job"); PlayerInfo[playerid][Warns] = dini_Int(file, "Warns"); PlayerInfo[playerid][Fleader] = dini_Int(file, "Fleader"); PlayerInfo[playerid][Fmember] = dini_Int(file, "Fmember"); PlayerInfo[playerid][Bank] = dini_Int(file, "Bank"); PlayerInfo[playerid][Prods] = dini_Int(file, "Prods"); PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel"); PlayerInfo[playerid][RepairOffer] = dini_Int(file, "RepairOffer"); PlayerInfo[playerid][Credit] = dini_Int(file, "Credit"); SetPlayerSkin(playerid, dini_Int(file, "Skin")); SendClientMessage(playerid,0xFF00CC, "[SYSTEM]: Successfully logged in!"); } } return 1; } public OnPlayerDisconnect(playerid, reason) { new name[24]; GetPlayerName(playerid,name,24); format(file,sizeof(file),"HZadmin/Users/%s.ini",name); if(dini_Exists(file)) { dini_IntSet(file,"Cash",GetPlayerMoney(playerid)); dini_IntSet(file,"Score",GetPlayerScore(playerid)); dini_IntSet(file,"Color",GetPlayerColor(playerid)); dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]); dini_IntSet(file,"Job",PlayerInfo[playerid][Job]); dini_IntSet(file,"Vw",GetPlayerVirtualWorld(playerid)); dini_IntSet(file,"Int",GetPlayerInterior(playerid)); dini_IntSet(file,"Warns",PlayerInfo[playerid][Warns]); dini_IntSet(file,"Fleader",PlayerInfo[playerid][Fleader]); dini_IntSet(file,"Fmember",PlayerInfo[playerid][Fmember]); dini_IntSet(file,"Bank",PlayerInfo[playerid][Bank]); dini_IntSet(file,"Prods",PlayerInfo[playerid][Prods]); dini_IntSet(file,"Skin",GetPlayerSkin(playerid)); dini_IntSet(file,"RepairOffer",PlayerInfo[playerid][RepairOffer]); dini_IntSet(file,"Credit",PlayerInfo[playerid][Credit]); dini_IntSet(file,"Color",PlayerInfo[playerid][Color]); IsLogged[playerid] = 0; return 1; } return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } //0------------------------------------------Server Commands----------------------------------0 COMMAND:acommands(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 1) { SendClientMessage(playerid,0xFF4500AA, "[System]Level:1 /explodecar /goto /gethere"); SendClientMessage(playerid,0xFF4500AA, "[System]Level:2 /flip "); SendClientMessage(playerid,0xFF4500AA, "[System]Level:3 /warn /kick /armourall /healall /armour"); SendClientMessage(playerid,0xFF4500AA, "[System]Level:4 /ban /announce /healadmin"); SendClientMessage(playerid,0xFF4500AA, "[System]Level:5 /god /godoff /jetpack /newadmin /kickall "); return 1; } else return SendClientMessage(playerid, 0xFF0000AA, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected."); } COMMAND:pm(playerid, params[]) { new str[128],id,pname[MAX_PLAYER_NAME], Message[128]; if(sscanf(params, "us[128]", id, Message)) SendClientMessage(playerid, 0x800080AA, "Usage: /pm <id> <message>"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, Red, "System: Player not connected"); if(playerid == id) SendClientMessage(playerid, Red, "System: You cannot pm yourself!"); else { GetPlayerName(id, str, 24); format(str, sizeof(str), "PM To %s(ID %d): %s", str, id, Message); GetPlayerName(id, str, 24); format(str, sizeof(str), "PM To %s(ID %d): %s", str, id, Message); SendClientMessage(playerid, 0xFF0000FF, str); GetPlayerName(playerid, pname, sizeof(pname)); format(str, sizeof(str), "PM From %s(ID %d): %s", pname, playerid, Message); SendClientMessage(id, 0xFF0000FF, str); } return 1; } COMMAND:god(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 5) { new string[256], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "Admin %s has Unleashed The Beast. God Mode ON", pname); SendClientMessageToAll(Green, string); SetPlayerHealth(playerid, 100000); TextDrawShowForPlayer(playerid, Text:godmodeon); TextDrawHideForPlayer(playerid, godmodeoff); new Float:pX, Float:pY, Float:pZ; PlayerPlaySound(playerid,1057,pX,pY,pZ); return 1; } else return SendClientMessage(playerid, 0xFF0000AA, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected."); } COMMAND:jail(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] >= 5) { if(isnull(params)) return SendClientMessage(playerid, Red, "Usage: /Jail [Player ID]"); new pID; if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, Red, "[System]That user is not connected!"); if(pID == playerid) return SendClientMessage(playerid, Red, "[System]You Cannot Jail Yourself!"); new iStr[80], iNameA[24]; GetPlayerName(playerid, iNameA, sizeof(iNameA)); format(iStr, sizeof(iStr), "%s has Jailed you!", iNameA); SendClientMessage(pID, Red, iStr); return SetPlayerPos(playerid,265.0000, 82.0000, 1002.0000); } else return SendClientMessage(playerid, Red, "You are not allowed to use this command."); } COMMAND:unjail(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] >= 5) { if(isnull(params)) return SendClientMessage(playerid, Red, "Usage: /UnJail [Player ID]"); new pID; if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, Red, "[System]That user is not connected!"); if(pID == playerid) return SendClientMessage(playerid, Red, "[System]You Cannot Jail Yourself!"); new iStr[80], iNameA[24]; GetPlayerName(playerid, iNameA, sizeof(iNameA)); format(iStr, sizeof(iStr), "%s has Unjailed you!", iNameA); SendClientMessage(pID, Red, iStr); return SetPlayerPos(playerid,1548.1687,-1675.2889,14.4035); } else return SendClientMessage(playerid, Red, "You are not allowed to use this command."); } COMMAND:godoff(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 5) { new string[256], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "Admin %s has Tamed The Beast. God Mode Off ", pname); SendClientMessageToAll(Red, string); SetPlayerHealth(playerid, 100); TextDrawShowForPlayer(playerid, Text:godmodeoff); TextDrawHideForPlayer(playerid, godmodeon); new Float:pX, Float:pY, Float:pZ; PlayerPlaySound(playerid,1057,pX,pY,pZ); return 1; } else return SendClientMessage(playerid, 0xFF0000AA, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected."); } COMMAND:goto(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 2) { new ID; if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xF97804FF, "USAGE: /goto [id]"); else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, 0xF97804FF, "Player is not connected!"); else { new Float:x, Float:y, Float:z; GetPlayerPos(ID, x, y, z); SetPlayerPos(playerid, x+1, y+1, z); } return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:flip(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 2) { if(IsPlayerInAnyVehicle(playerid)) { new VehicleID, Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); VehicleID = GetPlayerVehicleID(playerid); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, 0); SendClientMessage(playerid, 0xD8D8D8FF, "Vehicle fliped."); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not in any vehicle"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:explodecar(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 1) { if(IsPlayerInAnyVehicle(playerid)) { SetVehicleHealth(playerid,0); SendClientMessage(playerid, 0xD8D8D8FF, "Vehicle Expoloded."); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not in any vehicle"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:healadmin(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 5) { SetPlayerHealth(playerid,100); SendClientMessage(playerid, 0xD8D8D8FF, "You Have Healed Yourself."); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:report(playerid,params[]) { new name1[30], name2[30], id, text[128], reason[50]; if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,red,"USAGE: /report [id] [reason]"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"Invalid ID"); SendClientMessage(playerid,Green,"Your report has been Sent To An Admin, Thank You For The Report!"); GetPlayerName(playerid,name1,sizeof(name1)); GetPlayerName(id,name2,sizeof(name2)); new Hour,Minute,Second; gettime(Hour,Minute,Second); format(text,sizeof(text),"|| %d:%d:%d || [Report] | \"%s\" [%i] has reported \"%s\" [%i], reason: %s.",Hour,Minute,Second,name1,playerid,name2,id,reason); for(new i = 0; i < MAX_PLAYERS; ++i) { if(IsPlayerConnected(i) && !IsPlayerNPC(i) && IsPlayerAdmin(i)) SendClientMessage(i,COLOR_WHITE,text); } ReportLog(text); return 1; } COMMAND:kill(playerid, params[]) { SetPlayerHealth(playerid,0); return 1; } COMMAND:kickall(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 5) { for(new i = 0; i<MAX_PLAYERS; i++) { SetPlayerHealth(i, 0.0); SendClientMessage(playerid, -1, "All players have been killed."); } return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:admins(playerid, params[]) { new sendername[20]; new string[256]; if(IsPlayerConnected(playerid)) { SendClientMessage(playerid,Green,"Admins Online:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[playerid][AdminLevel] >= 1) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "Admin: %s", sendername); SendClientMessage(playerid, 0x9900FFAA, string); } } } } return 1; } COMMAND:healall(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 3) { for(new i = 0; i < MAX_PLAYERS; i++) { SetPlayerHealth(i, 150.0); } return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:armourall(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 3) { for(new i = 0; i < MAX_PLAYERS; i++) { SetPlayerArmour(i, 150.0); } return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:armour(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 3) { SetPlayerArmour(playerid, 150.0); } return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } COMMAND:jetpack(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 5) { SetPlayerSpecialAction(playerid, 2); //Spawns them a jetpack. SendClientMessage(playerid, Green, "**Spawned jetpack**"); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:newadmin(playerid, params[]) { new id; new AdminLevel2; if(IsPlayerConnected(id)) { if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) { if(!sscanf(params, "ui", id, AdminLevel2)) { if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0) { new string[64]; new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "%s Has Given You %d Admin Level.", name, AdminLevel2); SendClientMessage(id, 0xD8D8D8FF, string); format(string, sizeof(string), "You Gave %d Admin Level To %s .", AdminLevel2, PlayerName); SendClientMessage(playerid, 0xD8D8D8FF, string); PlayerInfo[id][AdminLevel] = AdminLevel2; return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "Avaliable Levels: 1, 2, 3, 4 and 5."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "System: /newadmin [PlayerId/PartOfName] [AdminLevel]"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "You Need Rcon Admin To Use This Command!"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player Is Not Connected"); } COMMAND:ban(playerid, params[]) { new id; if(IsPlayerConnected(id)) { if(PlayerInfo[playerid][AdminLevel] >= 4) { if(!sscanf(params, "u", id)) { new string[64]; new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "You Have Been Banned By %s.", name); SendClientMessage(id, 0xD8D8D8FF, string); format(string, sizeof(string), "You Banned %s .", id); SendClientMessage(playerid, 0xD8D8D8FF, string); Ban(id); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "System: /ban [PlayerId/PartOfName]"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Your Not High Enough Level To Use This Command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:kick(playerid, params[]) { new id; if(IsPlayerConnected(id)) { if(PlayerInfo[playerid][AdminLevel] >= 3) { if(!sscanf(params, "u", id)) { new string[64]; new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "You Have Been Kicked By %s.", name); SendClientMessage(id, 0xD8D8D8FF, string); format(string, sizeof(string), "You Kicked %s .", id); SendClientMessage(playerid, 0xD8D8D8FF, string); Kick(id); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "System: /kick [PlayerId/PartOfName]"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Your Not High Enough Level To Use This Command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:warn(playerid, params[]) { new id; if(IsPlayerConnected(id)) { if(PlayerInfo[playerid][AdminLevel] >= 3) { if(!sscanf(params, "u", id)) { new string[64]; new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "You have been warned by %s ", name); SendClientMessage(id, 0xD8D8D8FF, string); format(string, sizeof(string), "You have warn %s ", PlayerName); SendClientMessage(playerid, 0xD8D8D8FF, string); PlayerInfo[playerid][Warns] = PlayerInfo[playerid][Warns] +1; return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "System: /warn [PlayerId/PartOfName]"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Your Not High Enough Level To Use This Command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected."); } COMMAND:clearchat(playerid, params[]) { for(new i = 0; i < 50; i++) SendClientMessageToAll(0x33FF33AA," "); new Float:pX, Float:pY, Float:pZ; PlayerPlaySound(playerid,1057,pX,pY,pZ); return 1; } COMMAND:announce(playerid,params[]) { { if(PlayerInfo[playerid][AdminLevel] >= 4) { new poster[40], mess[128]; sscanf(params,"s",mess); if(!isnull(mess)) { new text[128]; GetPlayerName(playerid,poster,sizeof(poster)); format(text,sizeof(text),"Administrator \"%s\" has announced his message. (%s)",poster,mess); SendClientMessageToAll(0xD8D8D8FF,text); GameTextForAll(mess,5000,3); new Float:pX, Float:pY, Float:pZ; PlayerPlaySound(playerid,1057,pX,pY,pZ); } else { return SendClientMessage(playerid,red,"USAGE: /announce [message], and all players will see this message on-screen."); } } else { return SendClientMessage(playerid,red,"You are not allowed to use this command."); } return 1; } }