11.04.2012, 09:48
Can anyone gimme /aduty cmd pawn code for admins to get on Duty and offduty.
if(strcmp(cmd, "/aduty", true) == 0 || strcmp(cmd, "/aod", true) == 0) { if(PlayerInfo[playerid][pAdmin] >=1) { if(adminafk[playerid] == 1) { SendClientMessage(playerid,COLOR_2RED, "Nu ai voie sa te pui ON Duty daca esti AFK.Scrie /aafk intai."); return 0; } if(admind[playerid] == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new string2[256]; admind[playerid] = 1; format(string2,sizeof(string2), "AdmWarning: %s Este Acuma La Datorie.Scrie /w sau /report Daca Ai Nevoie De Ajutor", sendername); ABroadCast(COLOR_YELLOW,string2,1); } else { GetPlayerName(playerid, sendername, sizeof(sendername)); new string3[256]; admind[playerid] = 0; format(string3,sizeof(string3), "AdmWarning: %s Nu Mai Este La Datorie ca admin.", sendername); ABroadCast(COLOR_YELLOW,string3,1); } } return 1; } if(strcmp(cmd, "/aafk", true) == 0 || strcmp(cmd, "/adminafk", true) == 0) { if(admind[playerid] == 1) { SendClientMessage(playerid,COLOR_2RED, "Nu ai voie sa te pui AFK daca esti ON Duty.Trebuie sa fii OFF Duty"); return 0; } if(PlayerInfo[playerid][pAdmin] >=1) { if(adminafk[playerid] == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new string4[256]; adminafk[playerid] = 1; format(string4,sizeof(string4), "AdmWarning: %s Este Acum AFK. Nu are voie sa stea afk mai mult de 15 minute.", sendername); ABroadCast(COLOR_YELLOW,string4,1); } else { GetPlayerName(playerid, sendername, sizeof(sendername)); new string5[256]; adminafk[playerid] = 0; format(string5,sizeof(string5), "AdmWarning: %s Nu Mai Este AFK.Acum este gata sa se puna ON Duty.", sendername); ABroadCast(COLOR_YELLOW,string,1); } } return 1; }
CMD:aduty(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!"); if(PlayerInfo[playerid][pAdminDuty] == 0) { SendClientMessage(playerid, COLOR_GREEN, "You are now on administrative duty! Remember to check /reports!"); PlayerInfo[playerid][pAdminDuty] = 1; SetPlayerHealth(playerid, 100000); SetPlayerArmour(playerid, 100000); new string[128]; format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid)); SendClientMessageToAllEx(COLOR_YELLOW, string); } else { SendClientMessage(playerid, COLOR_RED, "You are now off admin duty!"); new string[128]; format(string, sizeof(string), "Administrator %s is now off Admin Duty! (Do not /report for him/her!)", GetPlayerNameEx(playerid)); SendClientMessageToAllEx(COLOR_LIGHTRED, string); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 50); PlayerInfo[playerid][pAdminDuty] = 0; } return 1; }