Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================//Includes
- #include <a_samp>
- #include <core>
- #include <float>
- #include <time>
- #include <file>
- #include <utils>
- //============================================================================//Defines
- #define COLOR_WRONGFORM 0xF3F3F3AA
- #define COLOR_W 0xF3F3F3AA
- #define COLOR_HELP 0x2F2FBBAA
- #define COLOR_H 0x2F2FBBAA
- #define COLOR_MESSAGE 0x41BEABAA
- #define COLOR_M 0x41BEABAA
- #define COLOR_CHATADMIN 0x3D46A0AA
- #define COLOR_ADMINCMD 0xDBA424AA
- #define COLOR_AFK 0xC85F3FF
- #define COLOR_PMIN 0xFF4600AA
- #define COLOR_PMOUT 0xFF7946AA
- #define COLOR_PM 0x008040AA
- #define COLOR_ADMINS 0xA2B83FF
- #define COLOR_CHATNAME 0x0000FFAA
- #define COLOR_CHAT 0xFFFFFFAA
- #define COLOR_ADMINCHAT 0x7ACD7CAA
- #define COLOR_CONNECT 0x408080AA
- #define COLOR_DISCONNECT 0x408080AA
- #define COLOR_CLOCKDATE 0x5550AFAA
- //PAM (PoWer Admin Mode) Created by PoWer.
- //All Right Reserved.
- //For any Help contact me at SA-MP Forums - PoWerZ,
- //or in the Release theard.
- //Made in Israel.
- // _____ _ _
- // || \\ \\ //
- // || || ======== \\ // _______
- // || // / \ \\ //\\ // // || || ======
- // ||__// | | \\ // \\ // || || ||/
- // || | | \\ // \\ // || =====/| ||
- // || \ / \\ // \\ // |\_______ ||
- // || ========= ====== ======
- //============================================================================//Publics
- forward SendClientMessageNoAFK(playerid, color, string[]);
- forward SendClientMessageToAllNoAFK(color, string[]);
- forward GameTextForAllNoAFK(string[], time, style);
- forward LoadAdministrationLoginInfo();
- forward SendAdminMessage(color, string[]);
- forward KickLog(string[]);
- forward BanLog(string[]);
- forward CountTimer();
- forward Go();
- forward IsAdmin(playerid);
- forward AdminConnect(playerid);
- forward NextStep(playerid);
- forward SetTime(hours);
- forward SetCount(Seconds);
- forward HideAdministrationLogin(playerid);
- forward ShowAdministrationLoginStep(playerid,stepnumber);
- forward CheckUsername(const string[],playerid);
- forward CheckPassword(const string[],playerid);
- forward split(const strsrc[], strdest[][], delimiter);
- forward SetClockDate();
- forward CheckJail();
- //============================================================================//TextDraws
- new Text:AFKBox;
- new Text:AFKText;
- new Text:AFKTextReturn;
- new Text:Clock;
- new Text:Date;
- new Text:AdminLoginBox;
- new Text:AdminTextMain;
- new Text:AdminText1;
- new Text:AdminText2;
- new Text:PasswordBox;
- new Text:PasswordText;
- new Text:UsernameText;
- new Text:ThePassword[MAX_PLAYERS];
- new Text:ContinueText;
- new Text:CancelText;
- new Text:CorrectPassword;
- new Text:CorrectUsername;
- new Text:CorrectUsernameText[MAX_PLAYERS];
- new Text:CorrectPasswordText[MAX_PLAYERS];
- new Text:WrongPassword;
- new Text:WrongUsername;
- new Text:TextJail;
- new Text:TimeJail[MAX_PLAYERS];
- //============================================================================//Statuses
- new CountTime = 0;
- new CountGo;
- new Count;
- new CountStatus = 0;
- new ChatStatus = 0;
- new Second = 1000;
- //============================================================================//Date/Clock TextDraws
- new YearTextDraw;
- new MonthTextDraw;
- new DayTextDraw;
- new HourTextDraw;
- new MinuteTextDraw;
- new SecondTextDraw;
- enum pInfo
- {
- PlayerLogin,
- PlayerUsername[128],
- PlayerPassword[128],
- AdminCount,
- NextStepCount,
- Mute,
- AFK,
- Spector,
- PlayerAdmin,
- AdminConnectTimer,
- NextStepTimer,
- UsernameNumber,
- ClockStatus,
- DateStatus,
- Float:LocationX,
- Float:LocationY,
- Float:LocationZ,
- JailStatus,
- JailMinutes,
- JailSeconds
- };
- new AdminModePlayerInfo[MAX_PLAYERS][pInfo]; //AdminMode Player Info
- enum Info
- {
- AdminUsername[128],
- AdminPassword[128],
- };
- new UPInfo[10][Info];//Username + Password AdministrationLogin Info (Max:10 Admins)
- public SetTime(hours)//For all players
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerTime(i,hours,00);
- }
- }
- return 1;
- }
- IsKeyJustDown(key, newkeys, oldkeys)
- {
- if((newkeys & key) && !(oldkeys & key)) return 1;
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
- {
- if(AdminModePlayerInfo[playerid][PlayerLogin] == 1)
- {
- LoadAdministrationLoginInfo();
- CheckUsername(AdminModePlayerInfo[playerid][PlayerUsername],playerid);
- return 1;
- }
- if(AdminModePlayerInfo[playerid][PlayerLogin] == 2)
- {
- LoadAdministrationLoginInfo();
- CheckPassword(AdminModePlayerInfo[playerid][PlayerPassword],playerid);
- return 1;
- }
- return 1;
- }
- else if(IsKeyJustDown(KEY_ACTION,newkeys,oldkeys))
- {
- if(AdminModePlayerInfo[playerid][PlayerLogin] == 1 || AdminModePlayerInfo[playerid][PlayerLogin] == 2)
- {
- HideAdministrationLogin(playerid);
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- AdminModePlayerInfo[playerid][UsernameNumber] = 255;
- return 1;
- }
- return 1;
- }
- return 1;
- }
- public split(const strsrc[], strdest[][], delimiter)
- {
- new i, li;
- new aNum;
- new len;
- while(i <= strlen(strsrc)){
- if(strsrc[i]==delimiter || i==strlen(strsrc)){
- len = strmid(strdest[aNum], strsrc, li, i, 128);
- strdest[aNum][len] = 0;
- li = i+1;
- aNum++;
- }
- i++;
- }
- return 1;
- }
- public SetClockDate()
- {
- new ClockString[256];
- new DateString[256];
- gettime(HourTextDraw, MinuteTextDraw, SecondTextDraw);
- getdate(YearTextDraw, MonthTextDraw, DayTextDraw);
- if(HourTextDraw < 10)
- {
- if(MinuteTextDraw < 10)
- {
- format(ClockString,sizeof(ClockString),"0%d:0%d",HourTextDraw,MinuteTextDraw);
- TextDrawSetString(Clock, ClockString);
- }
- else
- {
- format(ClockString,sizeof(ClockString),"0%d:%d",HourTextDraw,MinuteTextDraw);
- TextDrawSetString(Clock, ClockString);
- }
- }
- else
- {
- if(MinuteTextDraw < 10)
- {
- format(ClockString,sizeof(ClockString),"%d:0%d",HourTextDraw,MinuteTextDraw);
- TextDrawSetString(Clock, ClockString);
- }
- else
- {
- format(ClockString,sizeof(ClockString),"%d:%d",HourTextDraw,MinuteTextDraw);
- TextDrawSetString(Clock, ClockString);
- }
- }
- if(MonthTextDraw == 1)
- {
- format(DateString,sizeof(DateString),"%d ~w~January",DayTextDraw);
- }
- else if(MonthTextDraw == 2)
- {
- format(DateString,sizeof(DateString),"%d ~w~February",DayTextDraw);
- }
- else if(MonthTextDraw == 3)
- {
- format(DateString,sizeof(DateString),"%d ~w~March",DayTextDraw);
- }
- else if(MonthTextDraw == 4)
- {
- format(DateString,sizeof(DateString),"%d ~w~April",DayTextDraw);
- }
- else if(MonthTextDraw == 5)
- {
- format(DateString,sizeof(DateString),"%d ~w~May",DayTextDraw);
- }
- else if(MonthTextDraw == 6)
- {
- format(DateString,sizeof(DateString),"%d ~w~June",DayTextDraw);
- }
- else if(MonthTextDraw == 7)
- {
- format(DateString,sizeof(DateString),"%d ~w~July",DayTextDraw);
- }
- else if(MonthTextDraw == 8)
- {
- format(DateString,sizeof(DateString),"%d ~w~August",DayTextDraw);
- }
- else if(MonthTextDraw == 9)
- {
- format(DateString,sizeof(DateString),"%d ~w~September",DayTextDraw);
- }
- else if(MonthTextDraw == 10)
- {
- format(DateString,sizeof(DateString),"%d ~w~October",DayTextDraw);
- }
- else if(MonthTextDraw == 11)
- {
- format(DateString,sizeof(DateString),"%d ~w~November",DayTextDraw);
- }
- else if(MonthTextDraw == 12)
- {
- format(DateString,sizeof(DateString),"%d ~w~December",DayTextDraw);
- }
- TextDrawSetString(Date,DateString);
- return 1;
- }
- public CheckJail()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AdminModePlayerInfo[i][JailStatus] == 1)
- {
- new TimeString[256];
- AdminModePlayerInfo[i][JailSeconds] -= 1;
- if(AdminModePlayerInfo[i][JailSeconds] == -1)
- {
- if(AdminModePlayerInfo[i][JailMinutes] == 0)
- {
- AdminModePlayerInfo[i][JailStatus] = 0;
- AdminModePlayerInfo[i][JailMinutes] = 0;
- AdminModePlayerInfo[i][JailSeconds] = 0;
- SendClientMessageNoAFK(i,COLOR_M,"You unJailed Automaticly.");
- TextDrawHideForPlayer(i,TimeJail[i]);
- TextDrawSetString(TimeJail[i],"00:00 ~g~Min");
- TextDrawHideForPlayer(i,TextJail);
- SpawnPlayer(i);
- continue;
- }
- AdminModePlayerInfo[i][JailSeconds] = 59;
- AdminModePlayerInfo[i][JailMinutes] -= 1;
- if(AdminModePlayerInfo[i][JailMinutes] < 10)
- {
- if(AdminModePlayerInfo[i][JailSeconds] < 10)
- {
- format(TimeString,sizeof(TimeString),"0%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- else
- {
- format(TimeString,sizeof(TimeString),"0%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- }
- else
- {
- if(AdminModePlayerInfo[i][JailSeconds] < 10)
- {
- format(TimeString,sizeof(TimeString),"%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- else
- {
- format(TimeString,sizeof(TimeString),"%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- }
- }
- else
- {
- if(AdminModePlayerInfo[i][JailMinutes] < 10)
- {
- if(AdminModePlayerInfo[i][JailSeconds] < 10)
- {
- format(TimeString,sizeof(TimeString),"0%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- else
- {
- format(TimeString,sizeof(TimeString),"0%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- }
- else
- {
- if(AdminModePlayerInfo[i][JailSeconds] < 10)
- {
- format(TimeString,sizeof(TimeString),"%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- else
- {
- format(TimeString,sizeof(TimeString),"%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
- TextDrawSetString(TimeJail[i], TimeString);
- continue;
- }
- }
- }
- }
- }
- }
- return 1;
- }
- public LoadAdministrationLoginInfo()
- {
- new fileCoords[29][64];
- new StringfromFile[256];
- new File: AdminsFile = fopen("AdminMode/Admins.txt", io_read);
- if (AdminsFile)
- {
- new idx;
- while (idx < sizeof(UPInfo))
- {
- fread(AdminsFile, StringfromFile);
- split(StringfromFile, fileCoords, '|');
- strmid(UPInfo[idx][AdminUsername], fileCoords[0], 0, strlen(fileCoords[0]), 255);
- strmid(UPInfo[idx][AdminPassword], fileCoords[1], 0, strlen(fileCoords[1]), 255);
- idx++;
- }
- fclose(AdminsFile);
- }
- return 1;
- }
- public NextStep(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(AdminModePlayerInfo[playerid][NextStepCount] == 0)
- {
- TextDrawShowForPlayer(playerid,CorrectUsernameText[playerid]);
- AdminModePlayerInfo[playerid][NextStepCount] += 1;
- return 1;
- }
- else if(AdminModePlayerInfo[playerid][NextStepCount] == 1)
- {
- TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step..");
- AdminModePlayerInfo[playerid][NextStepCount] += 1;
- return 1;
- }
- else if(AdminModePlayerInfo[playerid][NextStepCount] == 2)
- {
- TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step...");
- AdminModePlayerInfo[playerid][NextStepCount] += 1;
- return 1;
- }
- else if(AdminModePlayerInfo[playerid][NextStepCount] == 3)
- {
- KillTimer(AdminModePlayerInfo[playerid][NextStepTimer]);
- AdminModePlayerInfo[playerid][NextStepCount] = 0;
- ShowAdministrationLoginStep(playerid,2);
- return 1;
- }
- }
- return 1;
- }
- public CheckUsername(const string[],playerid)
- {
- for(new u = 0; u < sizeof(UPInfo); u++)
- {
- if(strcmp(UPInfo[u][AdminUsername],string, true ) == 0)
- {
- if(strcmp("0",string, true ) == 0 || !strlen(string))
- {
- TextDrawShowForPlayer(playerid,WrongUsername);
- PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
- return 1;
- }
- else
- {
- new thePlayerUsername[256];
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- TextDrawHideForPlayer(playerid,WrongUsername);
- TextDrawShowForPlayer(playerid,CorrectUsername);
- PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
- format(thePlayerUsername, sizeof(thePlayerUsername), "0");
- strmid(AdminModePlayerInfo[playerid][PlayerUsername], thePlayerUsername, 0, strlen(thePlayerUsername), 255);
- AdminModePlayerInfo[playerid][UsernameNumber] = u;
- AdminModePlayerInfo[playerid][NextStepTimer] = SetTimerEx("NextStep",1000,1,"i",playerid);
- return 1;
- }
- }
- }
- TextDrawShowForPlayer(playerid,WrongUsername);
- PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
- return 1;
- }
- public CheckPassword(const string[],playerid)
- {
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- if(strcmp(UPInfo[AdminModePlayerInfo[playerid][UsernameNumber]][AdminPassword],string, true ) == 0)
- {
- if(strcmp("0",string, true ) == 0 || !strlen(string))
- {
- AdminModePlayerInfo[playerid][PlayerLogin] = 2;
- TextDrawShowForPlayer(playerid,WrongPassword);
- PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
- return 1;
- }
- else
- {
- new thePlayerPassword[256];
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- TextDrawHideForPlayer(playerid,WrongPassword);
- TextDrawShowForPlayer(playerid,CorrectPassword);
- TextDrawHideForPlayer(playerid,ContinueText);
- TextDrawHideForPlayer(playerid,CancelText);
- PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
- AdminModePlayerInfo[playerid][UsernameNumber] = 255;
- AdminModePlayerInfo[playerid][AdminCount] = 5;
- format(thePlayerPassword, sizeof(thePlayerPassword), "0");
- strmid(AdminModePlayerInfo[playerid][PlayerPassword], thePlayerPassword, 0, strlen(thePlayerPassword), 255);
- AdminModePlayerInfo[playerid][AdminConnectTimer] = SetTimerEx("AdminConnect",1000,1,"i",playerid);
- return 1;
- }
- }
- AdminModePlayerInfo[playerid][PlayerLogin] = 2;
- TextDrawShowForPlayer(playerid,WrongPassword);
- PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
- return 1;
- }
- public ShowAdministrationLoginStep(playerid,stepnumber)
- {
- if(stepnumber == 1)
- {
- if(IsPlayerConnected(playerid))
- {
- TextDrawShowForPlayer(playerid,UsernameText);
- TextDrawShowForPlayer(playerid,AdminLoginBox);
- TextDrawShowForPlayer(playerid,AdminTextMain);
- TextDrawShowForPlayer(playerid,AdminText1);
- TextDrawShowForPlayer(playerid,AdminText2);
- TextDrawShowForPlayer(playerid,PasswordBox);
- TextDrawShowForPlayer(playerid,ThePassword[playerid]);
- TextDrawShowForPlayer(playerid,ContinueText);
- TextDrawShowForPlayer(playerid,CancelText);
- return 1;
- }
- }
- else if(stepnumber == 2)
- {
- if(IsPlayerConnected(playerid))
- {
- KillTimer(AdminModePlayerInfo[playerid][NextStepTimer]);
- TextDrawHideForPlayer(playerid,UsernameText);
- TextDrawHideForPlayer(playerid,CorrectUsername);
- TextDrawHideForPlayer(playerid,CorrectUsernameText[playerid]);
- TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step.");
- TextDrawShowForPlayer(playerid,PasswordText);
- TextDrawShowForPlayer(playerid,AdminLoginBox);
- TextDrawShowForPlayer(playerid,AdminTextMain);
- TextDrawShowForPlayer(playerid,AdminText1);
- TextDrawShowForPlayer(playerid,AdminText2);
- TextDrawShowForPlayer(playerid,PasswordBox);
- TextDrawSetString(ThePassword[playerid],"_");
- TextDrawShowForPlayer(playerid,ThePassword[playerid]);
- TextDrawShowForPlayer(playerid,ContinueText);
- TextDrawShowForPlayer(playerid,CancelText);
- AdminModePlayerInfo[playerid][PlayerLogin] = 2;
- return 1;
- }
- }
- return 1;
- }
- public HideAdministrationLogin(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- TextDrawHideForPlayer(playerid,AdminLoginBox);
- TextDrawHideForPlayer(playerid,AdminTextMain);
- TextDrawHideForPlayer(playerid,AdminText1);
- TextDrawHideForPlayer(playerid,AdminText2);
- TextDrawHideForPlayer(playerid,PasswordBox);
- TextDrawHideForPlayer(playerid,UsernameText);
- TextDrawHideForPlayer(playerid,PasswordText);
- TextDrawHideForPlayer(playerid,ThePassword[playerid]);
- TextDrawHideForPlayer(playerid,ContinueText);
- TextDrawHideForPlayer(playerid,CancelText);
- TextDrawHideForPlayer(playerid,CorrectPassword);
- TextDrawHideForPlayer(playerid,CorrectUsername);
- TextDrawHideForPlayer(playerid,CorrectUsernameText[playerid]);
- TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step.");
- TextDrawSetString(ThePassword[playerid],"_");
- TextDrawHideForPlayer(playerid,CorrectPasswordText[playerid]);
- TextDrawHideForPlayer(playerid,WrongUsername);
- TextDrawHideForPlayer(playerid,WrongPassword);
- return 1;
- }
- return 1;
- }
- public AdminConnect(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- if(AdminModePlayerInfo[playerid][AdminCount] > 1)
- {
- TextDrawShowForPlayer(playerid,CorrectPasswordText[playerid]);
- new string[256];
- format(string,sizeof(string),"You'll log in more %d Seconds.",AdminModePlayerInfo[playerid][AdminCount]);
- TextDrawSetString(CorrectPasswordText[playerid],string);
- AdminModePlayerInfo[playerid][AdminCount] -= 1;
- return 1;
- }
- else if(AdminModePlayerInfo[playerid][AdminCount] == 1)
- {
- TextDrawShowForPlayer(playerid,CorrectPasswordText[playerid]);
- TextDrawSetString(CorrectPasswordText[playerid],"You'll log in more 1 Second.");
- AdminModePlayerInfo[playerid][AdminCount] -= 1;
- return 1;
- }
- else if(AdminModePlayerInfo[playerid][AdminCount] < 1)
- {
- HideAdministrationLogin(playerid);
- KillTimer(AdminModePlayerInfo[playerid][AdminConnectTimer]);
- AdminModePlayerInfo[playerid][AdminCount] = 5;
- AdminModePlayerInfo[playerid][PlayerAdmin] = 1;
- AdminModePlayerInfo[playerid][UsernameNumber] = 255;
- SendClientMessageNoAFK(playerid,COLOR_M,"Wellcome,Admin.");
- SendClientMessageNoAFK(playerid,COLOR_M,"To see the Admin Commands type /adminhelp Or /ah.");
- return 1;
- }
- }
- 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 SendAdminMessage(color, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsAdmin(i))
- {
- if(AdminModePlayerInfo[i][AFK] == 0)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- }
- return 1;
- }
- public SendClientMessageNoAFK(playerid, color, string[])
- {
- if(AdminModePlayerInfo[playerid][AFK] == 0)
- {
- SendClientMessage(playerid, color, string);
- return 1;
- }
- return 1;
- }
- public SendClientMessageToAllNoAFK(color, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AdminModePlayerInfo[i][AFK] == 0)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- public GameTextForAllNoAFK(string[], time, style)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AdminModePlayerInfo[i][AFK] == 0)
- {
- GameTextForPlayer(i, string, time, style);
- }
- }
- }
- return 1;
- }
- public SetCount(Seconds)
- {
- CountTime = Seconds;
- return 1;
- }
- public CountTimer()
- {
- if(CountTime != 0)
- {
- new stringTime[256];
- format(stringTime,sizeof(stringTime),"~b~%d",CountTime);
- GameTextForAllNoAFK(stringTime, 1500, 3);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AdminModePlayerInfo[i][AFK] == 0)
- {
- PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
- }
- }
- }
- CountTime -= 1;
- return 1;
- }
- else
- {
- KillTimer(Count);
- CountGo = SetTimer("Go",0,0);
- CountTime = 0;
- return 1;
- }
- }
- public Go()
- {
- new stringTime[256];
- format(stringTime,sizeof(stringTime),"~g~GO!");
- GameTextForAllNoAFK(stringTime, 1500, 3);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AdminModePlayerInfo[i][AFK] == 0)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- }
- }
- }
- CountStatus = 0;
- return 1;
- }
- public IsAdmin(playerid)
- {
- if(AdminModePlayerInfo[playerid][PlayerAdmin] == 1)
- {
- return 1;
- }
- return 0;
- }
- public KickLog(string[])
- {
- new KickText[256];
- new File:KickFile;
- format(KickText, sizeof(KickText), "%s\n",string);
- KickFile = fopen("AdminMode/Kick.txt", io_append);
- fwrite(KickFile, KickText);
- fclose(KickFile);
- return 1;
- }
- public BanLog(string[])
- {
- new BanText[256];
- new File:BanFile;
- format(BanText, sizeof(BanText), "%s\n",string);
- BanFile = fopen("AdminMode/Ban.txt", io_append);
- fwrite(BanFile, BanText);
- fclose(BanFile);
- return 1;
- }
- public OnFilterScriptInit()
- {
- AdminLoginBox = TextDrawCreate(528.000000,108.000000,"_");
- AdminTextMain = TextDrawCreate(214.000000,111.000000,"Administration Login");
- AdminText1 = TextDrawCreate(190.000000,155.000000,"Please type your Administor Username");
- AdminText2 = TextDrawCreate(189.000000,175.000000,"and Password to connect as Admin.");
- PasswordBox = TextDrawCreate(497.000000,212.000000,"_");
- PasswordText = TextDrawCreate(159.000000,207.000000,"Password :");
- UsernameText = TextDrawCreate(159.000000,207.000000,"Username :");
- ContinueText = TextDrawCreate(174.000000,292.000000,"Press ~b~~k~~PED_SPRINT~~w~ to Continue");
- CancelText = TextDrawCreate(174.000000,318.000000,"Press ~b~~k~~PED_ANSWER_PHONE~~w~ to Cancel");
- CorrectPassword = TextDrawCreate(219.000000,235.000000,"Correct Password");
- CorrectUsername = TextDrawCreate(219.000000,235.000000,"Correct Username");
- WrongPassword = TextDrawCreate(219.000000,235.000000,"Wrong Password");
- WrongUsername = TextDrawCreate(219.000000,235.000000,"Wrong Username");
- AFKBox = TextDrawCreate(645.000000,1.000000,"-");
- AFKText = TextDrawCreate(270.000000,164.000000,"AFK");
- AFKTextReturn = TextDrawCreate(106.000000,237.000000,"to return to Game type /AFK");
- Clock = TextDrawCreate(258.000000,295.000000,"Clock");
- Date = TextDrawCreate(238.000000,322.000000,"Date");
- TextJail = TextDrawCreate(244.000000,108.000000,"Jail Time");
- TextDrawAlignment(Clock,0);
- TextDrawAlignment(Date,0);
- TextDrawBackgroundColor(Clock,0x000000ff);
- TextDrawBackgroundColor(Date,0x000000ff);
- TextDrawFont(Clock,3);
- TextDrawLetterSize(Clock,0.799999,2.200000);
- TextDrawFont(Date,3);
- TextDrawLetterSize(Date,0.899999,2.200000);
- TextDrawColor(Clock,COLOR_CLOCKDATE);
- TextDrawColor(Date,COLOR_CLOCKDATE);
- TextDrawSetOutline(Clock,1);
- TextDrawSetOutline(Date,1);
- TextDrawSetProportional(Clock,1);
- TextDrawSetProportional(Date,1);
- TextDrawSetShadow(Clock,1);
- TextDrawSetShadow(Date,1);
- TextDrawAlignment(TextJail,0);
- TextDrawBackgroundColor(TextJail,0x000000ff);
- TextDrawFont(TextJail,3);
- TextDrawLetterSize(TextJail,0.799999,2.900000);
- TextDrawColor(TextJail,0x008000AA);
- TextDrawSetOutline(TextJail,1);
- TextDrawSetProportional(TextJail,1);
- TextDrawSetShadow(TextJail,1);
- TextDrawLetterSize(AFKBox,0,50);
- TextDrawUseBox(AFKBox,1);
- TextDrawColor(AFKBox,0x000000ff);
- TextDrawTextSize(AFKBox,-3.000000,17.000000);
- TextDrawBoxColor(AFKBox,0x000000ff);
- TextDrawLetterSize(AFKText,1.000000,3.699999);
- TextDrawBackgroundColor(AFKBox,0x000000ff);
- TextDrawFont(AFKBox,3);
- TextDrawLetterSize(AFKBox,-34.600002,49.399997);
- TextDrawFont(AFKText,1);
- TextDrawFont(AFKTextReturn,1);
- TextDrawLetterSize(AFKTextReturn,0.800000,4.399999);
- TextDrawColor(AFKText,0xff0000ff);
- TextDrawColor(AFKTextReturn,0xff0000ff);
- TextDrawUseBox(AdminLoginBox,1);
- TextDrawBoxColor(AdminLoginBox,0x00000099);
- TextDrawTextSize(AdminLoginBox,129.000000,-24.000000);
- TextDrawUseBox(PasswordBox,1);
- TextDrawBoxColor(PasswordBox,0xffffffcc);
- TextDrawTextSize(PasswordBox,260.000000,-47.000000);
- TextDrawAlignment(AdminLoginBox,0);
- TextDrawAlignment(AdminTextMain,0);
- TextDrawAlignment(AdminText1,0);
- TextDrawAlignment(AdminText2,0);
- TextDrawAlignment(PasswordBox,0);
- TextDrawAlignment(PasswordText,0);
- TextDrawAlignment(UsernameText,0);
- TextDrawAlignment(ContinueText,0);
- TextDrawAlignment(CancelText,0);
- TextDrawBackgroundColor(AdminLoginBox,0x000000ff);
- TextDrawBackgroundColor(AdminTextMain,0x000000ff);
- TextDrawBackgroundColor(AdminText1,0xffffffff);
- TextDrawBackgroundColor(AdminText2,0xffffffff);
- TextDrawBackgroundColor(PasswordBox,0x0000ffcc);
- TextDrawBackgroundColor(PasswordText,0xffffff66);
- TextDrawBackgroundColor(UsernameText,0xffffff66);
- TextDrawBackgroundColor(ContinueText,0x000000ff);
- TextDrawBackgroundColor(CancelText,0x000000ff);
- TextDrawFont(AdminLoginBox,3);
- TextDrawLetterSize(AdminLoginBox,1.000000,27.000000);
- TextDrawFont(AdminTextMain,0);
- TextDrawLetterSize(AdminTextMain,0.899999,2.700000);
- TextDrawFont(AdminText1,3);
- TextDrawLetterSize(AdminText1,0.400000,1.300001);
- TextDrawFont(AdminText2,3);
- TextDrawLetterSize(AdminText2,0.399999,1.400000);
- TextDrawFont(PasswordBox,3);
- TextDrawLetterSize(PasswordBox,1.000000,1.200000);
- TextDrawFont(PasswordText,3);
- TextDrawLetterSize(PasswordText,0.499999,2.200001);
- TextDrawFont(UsernameText,3);
- TextDrawLetterSize(UsernameText,0.499999,2.200001);
- TextDrawFont(ContinueText,3);
- TextDrawLetterSize(ContinueText,0.499999,1.900000);
- TextDrawFont(CancelText,3);
- TextDrawLetterSize(CancelText,0.499999,1.700000);
- TextDrawColor(AdminLoginBox,0xffffffff);
- TextDrawColor(AdminTextMain,0xffffffff);
- TextDrawColor(AdminText1,0x000000cc);
- TextDrawColor(AdminText2,0x000000cc);
- TextDrawColor(PasswordBox,0xffffffff);
- TextDrawColor(PasswordText,0xffffffcc);
- TextDrawColor(UsernameText,0xffffffcc);
- TextDrawColor(ContinueText,0xffffffff);
- TextDrawColor(CancelText,0xffffffff);
- TextDrawSetOutline(AdminLoginBox,1);
- TextDrawSetOutline(AdminTextMain,1);
- TextDrawSetOutline(AdminText1,1);
- TextDrawSetOutline(AdminText2,1);
- TextDrawSetOutline(ContinueText,1);
- TextDrawSetOutline(CancelText,1);
- TextDrawAlignment(WrongPassword,0);
- TextDrawAlignment(WrongUsername,0);
- TextDrawBackgroundColor(WrongPassword,0x000000ff);
- TextDrawBackgroundColor(WrongUsername,0x000000ff);
- TextDrawFont(WrongPassword,0);
- TextDrawFont(WrongUsername,0);
- TextDrawLetterSize(WrongPassword,0.899999,2.299999);
- TextDrawLetterSize(WrongUsername,0.899999,2.299999);
- TextDrawColor(WrongPassword,0xff0000ff);
- TextDrawColor(WrongUsername,0xff0000ff);
- TextDrawSetOutline(WrongPassword,1);
- TextDrawSetOutline(WrongUsername,1);
- TextDrawSetProportional(WrongPassword,1);
- TextDrawSetProportional(WrongUsername,1);
- TextDrawSetShadow(WrongPassword,1);
- TextDrawSetShadow(WrongUsername,1);
- TextDrawAlignment(CorrectPassword,0);
- TextDrawAlignment(CorrectUsername,0);
- TextDrawBackgroundColor(CorrectPassword,0x000000ff);
- TextDrawBackgroundColor(CorrectUsername,0x000000ff);
- TextDrawLetterSize(CorrectPassword,0.899999,2.299999);
- TextDrawLetterSize(CorrectUsername,0.899999,2.299999);
- TextDrawColor(CorrectPassword,0x00ff00cc);
- TextDrawColor(CorrectUsername,0x00ff00cc);
- TextDrawSetOutline(CorrectPassword,1);
- TextDrawSetOutline(CorrectUsername,1);
- TextDrawSetProportional(CorrectPassword,1);
- TextDrawSetProportional(CorrectUsername,1);
- TextDrawSetShadow(CorrectPassword,1);
- TextDrawSetShadow(CorrectUsername,1);
- TextDrawFont(CorrectPassword,0);
- TextDrawFont(CorrectUsername,0);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- ThePassword[i] = TextDrawCreate(270.000000,210.000000,"_");
- CorrectUsernameText[i] = TextDrawCreate(191.000000,261.000000,"Moving to the next Step.");
- CorrectPasswordText[i] = TextDrawCreate(191.000000,261.000000,"You'll log in more 5 Seconds.");
- TimeJail[i] = TextDrawCreate(238.000000,138.000000,"00:00 ~g~Min");
- TextDrawBackgroundColor(TimeJail[i],0x000000ff);
- TextDrawLetterSize(TimeJail[i],0.799999,3.100000);
- TextDrawColor(TimeJail[i],0xffffffff);
- TextDrawSetOutline(TimeJail[i],1);
- TextDrawSetProportional(TimeJail[i],1);
- TextDrawSetShadow(TimeJail[i],1);
- TextDrawAlignment(TimeJail[i],0);
- TextDrawFont(TimeJail[i],3);
- TextDrawSetOutline(ThePassword[i],1);
- TextDrawColor(ThePassword[i],0xffffffcc);
- TextDrawFont(ThePassword[i],3);
- TextDrawLetterSize(ThePassword[i],0.599999,1.600000);
- TextDrawBackgroundColor(ThePassword[i],0x00000099);
- TextDrawAlignment(ThePassword[i],0);
- TextDrawAlignment(CorrectPasswordText[i],0);
- TextDrawBackgroundColor(CorrectPasswordText[i],0xffffffcc);
- TextDrawLetterSize(CorrectPasswordText[i],0.399999,1.999999);
- TextDrawColor(CorrectPasswordText[i],0x000000cc);
- TextDrawFont(CorrectPasswordText[i],2);
- TextDrawSetOutline(CorrectPasswordText[i],1);
- TextDrawSetProportional(CorrectPasswordText[i],1);
- TextDrawSetShadow(CorrectPasswordText[i],1);
- TextDrawAlignment(CorrectUsernameText[i],0);
- TextDrawBackgroundColor(CorrectUsernameText[i],0xffffffcc);
- TextDrawLetterSize(CorrectUsernameText[i],0.399999,1.999999);
- TextDrawColor(CorrectUsernameText[i],0x000000cc);
- TextDrawFont(CorrectUsernameText[i],2);
- TextDrawSetOutline(CorrectUsernameText[i],1);
- TextDrawSetProportional(CorrectUsernameText[i],1);
- TextDrawSetShadow(CorrectUsernameText[i],1);
- }
- CountStatus = 0;
- SetTimer("SetClockDate",1000,1);
- SetTimer("CheckJail",1000,1);
- print("\n|------------------------------------|");
- print("|PoWer Admin Mode Loaded Succesfully.|");
- print("|------------------------------------|\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid,COLOR_CONNECT, "This server uses PoWer - Admin Mode.");
- new string[64];
- new PlayerConnecting[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerConnecting, sizeof(PlayerConnecting));
- format(string, sizeof(string), "%s[ID:%d] Connected to The Server.", PlayerConnecting, playerid);
- SendClientMessageToAllNoAFK(COLOR_CONNECT, string);
- AdminModePlayerInfo[playerid][AFK] = 0;
- AdminModePlayerInfo[playerid][Mute] = 0;
- AdminModePlayerInfo[playerid][Spector] = 0;
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- AdminModePlayerInfo[playerid][AdminCount] = 0;
- AdminModePlayerInfo[playerid][PlayerAdmin] = 0;
- AdminModePlayerInfo[playerid][UsernameNumber] = 255;
- AdminModePlayerInfo[playerid][NextStepCount] = 0;
- AdminModePlayerInfo[playerid][ClockStatus] = 0;
- AdminModePlayerInfo[playerid][DateStatus] = 0;
- AdminModePlayerInfo[playerid][LocationX] = 0;
- AdminModePlayerInfo[playerid][LocationY] = 0;
- AdminModePlayerInfo[playerid][LocationZ] = 0;
- AdminModePlayerInfo[playerid][JailStatus] = 0;
- AdminModePlayerInfo[playerid][JailMinutes] = 0;
- AdminModePlayerInfo[playerid][JailSeconds] = 0;
- TextDrawSetString(ThePassword[playerid],"_");
- TextDrawSetString(TimeJail[playerid],"00:00 ~g~Min");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new string[64];
- new PlayerDisconnecting[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerDisconnecting, sizeof(PlayerDisconnecting));
- if(reason == 0)
- {
- format(string, sizeof(string), "%s[ID:%d] Disconnected The Server.(Timed out)", PlayerDisconnecting, playerid);
- }
- else if(reason == 1)
- {
- format(string, sizeof(string), "%s[ID:%d] Disconnected from The Server.(Left)", PlayerDisconnecting, playerid);
- }
- else if(reason == 2)
- {
- format(string, sizeof(string), "%s[ID:%d] Disconnected from The Server.(Kicked/Banned)", PlayerDisconnecting, playerid);
- }
- SendClientMessageToAllNoAFK(COLOR_DISCONNECT, string);
- AdminModePlayerInfo[playerid][AFK] = 0;
- AdminModePlayerInfo[playerid][Mute] = 0;
- AdminModePlayerInfo[playerid][Spector] = 0;
- AdminModePlayerInfo[playerid][PlayerLogin] = 0;
- AdminModePlayerInfo[playerid][AdminCount] = 0;
- AdminModePlayerInfo[playerid][PlayerAdmin] = 0;
- AdminModePlayerInfo[playerid][UsernameNumber] = 255;
- AdminModePlayerInfo[playerid][NextStepCount] = 0;
- AdminModePlayerInfo[playerid][ClockStatus] = 0;
- AdminModePlayerInfo[playerid][DateStatus] = 0;
- AdminModePlayerInfo[playerid][LocationX] = 0;
- AdminModePlayerInfo[playerid][LocationY] = 0;
- AdminModePlayerInfo[playerid][LocationZ] = 0;
- AdminModePlayerInfo[playerid][JailStatus] = 0;
- AdminModePlayerInfo[playerid][JailMinutes] = 0;
- AdminModePlayerInfo[playerid][JailSeconds] = 0;
- TextDrawSetString(ThePassword[playerid],"_");
- TextDrawSetString(TimeJail[playerid],"00:00 ~g~Min");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(AdminModePlayerInfo[playerid][AFK] == 1)
- {
- TogglePlayerControllable(playerid, 0);
- TextDrawShowForPlayer(playerid,AFKBox);
- TextDrawShowForPlayer(playerid,AFKText);
- TextDrawShowForPlayer(playerid,AFKTextReturn);
- SetPlayerVirtualWorld(playerid,playerid+1);
- return 1;
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(AdminModePlayerInfo[playerid][Mute] == 0)
- {
- if(AdminModePlayerInfo[playerid][AFK] == 0)
- {
- if(AdminModePlayerInfo[playerid][PlayerLogin] == 1)
- {
- new string[256];
- format(string, sizeof(string), "%s", text);
- strmid(AdminModePlayerInfo[playerid][PlayerUsername], string, 0, strlen(string), 255);
- TextDrawSetString(ThePassword[playerid],text);
- return 0;
- }
- else if(AdminModePlayerInfo[playerid][PlayerLogin] == 2)
- {
- new string[256];
- format(string, sizeof(string), "%s", text);
- strmid(AdminModePlayerInfo[playerid][PlayerPassword], string, 0, strlen(string), 255);
- TextDrawSetString(ThePassword[playerid],text);
- return 0;
- }
- else
- {
- if(ChatStatus == 0)
- {
- if(IsAdmin(playerid))
- {
- new stringtext[256];
- new playername[256];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(stringtext,sizeof(stringtext),"|Admin|%s[ID:%d]: %s",playername,playerid,text);
- SendClientMessageToAllNoAFK(COLOR_ADMINCHAT,stringtext);
- return 0;
- }
- else
- {
- new stringtext[256];
- new playername[256];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(stringtext,sizeof(stringtext),"%s[ID:%d]: %s",playername,playerid,text);
- SendClientMessageToAllNoAFK(COLOR_CHAT,stringtext);
- return 0;
- }
- }
- else
- {
- if(IsAdmin(playerid))
- {
- new stringtext[256];
- new playername[256];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(stringtext,sizeof(stringtext),"|Admin|%s[ID:%d]: %s",playername,playerid,text);
- SendClientMessageToAllNoAFK(COLOR_ADMINCHAT,stringtext);
- return 0;
- }
- else
- {
- SendClientMessage(playerid, COLOR_W, "Chat Close,You can't Write nothing!");
- return 0;
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_W, "You Are AFK,You can't Write nothing!");
- return 0;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_W, "You Muted,You can't Write nothing!");
- return 0;
- }
- }
- public OnPlayerPrivmsg(playerid, recieverid, text[])
- {
- new string[256], sendername[24],givename[24];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(recieverid, givename, sizeof(givename));
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsAdmin(i))
- {
- format(string, sizeof (string), "PM: %s[ID:%d] To %s[ID:%d]: %s", sendername, playerid, givename, recieverid, text);
- SendClientMessageNoAFK(i, COLOR_PM, string);
- }
- }
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[256];
- new giveplayername[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- new cmd[256];
- new tmp[256];
- new idx;
- new giveplayerid;
- cmd = strtok(cmdtext, idx);
- if(AdminModePlayerInfo[playerid][AFK] == 0)
- {
- //----------------------------------------[Interior Commands]----------------------------------------|
- if(strcmp(cmd, "/setinterior", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setinterior [Interior ID]");
- return 1;
- }
- new interiorid;
- interiorid = strval(tmp);
- SetPlayerInterior(playerid,interiorid);
- format(string, sizeof(string), "Your Interior Switched to |%d|.", interiorid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/getinterior", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Getinterior [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new interiorid;
- interiorid = GetPlayerInterior(giveplayerid);
- format(string, sizeof(string), "The Interior of %s[ID:%d] is |%d|.", giveplayername, giveplayerid, interiorid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- //----------------------------------------[Teleport Commands]----------------------------------------|
- if(strcmp(cmd, "/tpto", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPto [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new CurrentState = GetPlayerState(playerid);
- if(CurrentState == PLAYER_STATE_PASSENGER)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(giveplayerid);
- SetPlayerInterior(playerid,interiorid);
- GetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- SetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- format(string, sizeof(string), "You teleported to %s[ID:%d].", giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- else if(CurrentState == PLAYER_STATE_DRIVER)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(giveplayerid);
- GetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- new VehicleID = GetPlayerVehicleID(playerid);
- LinkVehicleToInterior(VehicleID,interiorid);
- SetVehiclePos(VehicleID, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- SetPlayerInterior(playerid,interiorid);
- format(string, sizeof(string), "You teleported to %s[ID:%d].", giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- else
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(giveplayerid);
- SetPlayerInterior(playerid,interiorid);
- GetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- SetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- format(string, sizeof(string), "You teleported to %s[ID:%d].", giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/tphere", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPhere [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- new CurrentState = GetPlayerState(giveplayerid);
- if(CurrentState == PLAYER_STATE_PASSENGER)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(playerid);
- SetPlayerInterior(giveplayerid,interiorid);
- GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- format(string, sizeof(string), "%s[ID:%d] Teleported to You.", giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- else if(CurrentState == PLAYER_STATE_DRIVER)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- new VehicleID = GetPlayerVehicleID(giveplayerid);
- LinkVehicleToInterior(VehicleID,interiorid);
- SetVehiclePos(VehicleID, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- SetPlayerInterior(giveplayerid,interiorid);
- format(string, sizeof(string), "%s[ID:%d] Teleported to You with Vehicle.", giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- else
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(playerid);
- SetPlayerInterior(giveplayerid,interiorid);
- GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- format(string, sizeof(string), "%s[ID:%d] Teleported to You.", giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/tphereall", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- interiorid = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(i != playerid)
- {
- SetPlayerInterior(i,interiorid);
- SetPlayerPos(i, PlayerPosX, PlayerPosY, PlayerPosZ+5);
- }
- }
- }
- format(string, sizeof(string), "Admin %s[ID:%d] Tped all Players.",sendername,playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/tptp", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPtp [Playerid/PartOfName to Teleport] [Playerid/PartOfName Destination]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPtp [Playerid/PartOfName to Teleport] [Playerid/PartOfName Destination]");
- return 1;
- }
- new destinationgiveplayername[256];
- new destinationgiveplayerid;
- destinationgiveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(destinationgiveplayerid))
- {
- if(destinationgiveplayerid != INVALID_PLAYER_ID)
- {
- new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
- new interiorid;
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(destinationgiveplayerid, destinationgiveplayername, sizeof(destinationgiveplayername));
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- new CurrentState = GetPlayerState(giveplayerid);
- if(CurrentState == PLAYER_STATE_PASSENGER)
- {
- interiorid = GetPlayerInterior(destinationgiveplayerid);
- SetPlayerInterior(giveplayerid,interiorid);
- GetPlayerPos(destinationgiveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- format(string, sizeof(string), "You teleported %s[ID:%d] to %s[ID:%d].", giveplayername,giveplayerid,destinationgiveplayername,destinationgiveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- else if(CurrentState == PLAYER_STATE_DRIVER)
- {
- interiorid = GetPlayerInterior(destinationgiveplayerid);
- GetPlayerPos(destinationgiveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- new VehicleID = GetPlayerVehicleID(giveplayerid);
- LinkVehicleToInterior(VehicleID,interiorid);
- SetVehiclePos(VehicleID, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- SetPlayerInterior(giveplayerid,interiorid);
- format(string, sizeof(string), "You teleported %s[ID:%d] with vehicle to %s[ID:%d].", giveplayername,giveplayerid,destinationgiveplayername,destinationgiveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- else
- {
- interiorid = GetPlayerInterior(destinationgiveplayerid);
- SetPlayerInterior(giveplayerid,interiorid);
- GetPlayerPos(destinationgiveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
- SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
- format(string, sizeof(string), "You teleported %s[ID:%d] to %s[ID:%d].", giveplayername,giveplayerid,destinationgiveplayername,destinationgiveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !(Player to teleport)");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !(Player Destination)");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- //----------------------------------------[un/Freeze Commands]----------------------------------------|
- if(strcmp(cmd, "/freeze", true) == 0 || strcmp(cmd, "/f", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Freeze [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid == playerid)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessageNoAFK(playerid,COLOR_M,"You Froze Yourself.");
- format(string, sizeof(string), "Admin %s Froze by himself.",sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- TogglePlayerControllable(playerid, 0);
- return 1;
- }
- if(IsAdmin(giveplayerid))
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Freeze an Admin !");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- TogglePlayerControllable(giveplayerid, 0);
- format(string, sizeof(string), "You Froze %s[ID:%d].",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been Frozen By Admin %s[ID:%d].",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s Froze by Admin %s",giveplayername ,sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unfreeze", true) == 0 || strcmp(cmd, "/unf", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Unfreeze [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid == playerid)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessageNoAFK(playerid,COLOR_M,"You unFroze Yourself.");
- format(string, sizeof(string), "Admin %s unFrozen by himself.",sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- if(IsAdmin(giveplayerid))
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You Can not unFreeze an Admin !");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- TogglePlayerControllable(giveplayerid, 1);
- format(string, sizeof(string), "You unFroze %s[ID:%d].",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been unFrozen By Admin %s[ID:%d].",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s unFrozen by Admin %s",giveplayername ,sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/freezeall", true) == 0 || strcmp(cmd, "/fa", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- TogglePlayerControllable(i, 0);
- }
- }
- format(string, sizeof(string), "Admin %s[ID:%d] Froze all Players.",sendername,playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unfreezeall", true) == 0 || strcmp(cmd, "/unfa", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- TogglePlayerControllable(i, 1);
- }
- }
- format(string, sizeof(string), "Admin %s[ID:%d] unFroze all Players.",sendername,playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Fix Vehicle Command]----------------------------------------|
- if(strcmp(cmd, "/fixvehicle", true) == 0 || strcmp(cmd, "/fixveh", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- giveplayerid = ReturnUser(tmp);
- new VehicleID = GetPlayerVehicleID(giveplayerid);
- SetVehicleHealth(VehicleID,1000);
- SendClientMessageNoAFK(playerid,COLOR_M,"Vehicle fixed.");
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not in a Vehicle !");
- return 1;
- }
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You fixed %s[ID:%d] Vehicle.",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "Your Vehicle fixed By Admin %s[ID:%d].",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Set HP/Armor Commands]----------------------------------------|
- if(strcmp(cmd, "/sethp", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Sethp [Playerid/PartOfName] [Health]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Sethp [Playerid/PartOfName] [Health]");
- return 1;
- }
- new hp;
- hp = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You changed %s[ID:%d] Health to %d.",giveplayername,giveplayerid,hp);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- SetPlayerHealth(giveplayerid,hp);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/setarmor", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setarmor [Playerid/PartOfName] [Armor]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setarmor [Playerid/PartOfName] [Armor]");
- return 1;
- }
- new armor;
- armor = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You changed %s[ID:%d] Armour to %d.",giveplayername,giveplayerid,armor);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- SetPlayerArmour(giveplayerid,armor);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Set HP/Armor All Commands]----------------------------------------|
- if(strcmp(cmd, "/hp", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerHealth(i, 100);
- }
- }
- format(string, sizeof(string), "Admin %s[ID:%d] Raised all Players Health.",sendername,playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/armor", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin %s[ID:%d] Raised all Players Armour.",sendername,playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerArmour(i, 100);
- }
- }
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Set Skin Command]----------------------------------------|
- if(strcmp(cmd, "/setskin", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setskin [Playerid/PartOfName] [Skin ID]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setskin [Playerid/PartOfName] [Skin ID]");
- return 1;
- }
- new skin;
- skin = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You changed %s[ID:%d] Skin to %d.",giveplayername,giveplayerid,skin);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "Your Skin changed to %d By Admin %s[ID:%d]",skin,sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- SetPlayerSkin(giveplayerid,skin);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Money Commands]----------------------------------------|
- if(strcmp(cmd, "/setmoney", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setmoney [Playerid/PartOfName] [Amount]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setmoney [Playerid/PartOfName] [Amount]");
- return 1;
- }
- new money;
- money = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You Set %s[ID:%d] Money to $%d.",giveplayername,giveplayerid,money);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "Your Money set to $%d By Admin %s[ID:%d]",money,sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- ResetPlayerMoney(giveplayerid);
- GivePlayerMoney(giveplayerid, money);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/givemoney", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Givemoney [Playerid/PartOfName] [Amount]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Givemoney [Playerid/PartOfName] [Amount]");
- return 1;
- }
- new money;
- money = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You Added $%d to %s[ID:%d].",money,giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You Got from Admin %s[ID:%d] $%d.",sendername,playerid,money);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- GivePlayerMoney(giveplayerid,money);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/takemoney", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Takemoney [Playerid/PartOfName] [Amount]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Takemoney [Playerid/PartOfName] [Amount]");
- return 1;
- }
- new money;
- money = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You Took $%d from %s[ID:%d].",money,giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "$%d Took By Admin %s[ID:%d].",sendername,playerid,money);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- GivePlayerMoney(giveplayerid,-money);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/checkmoney", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Checkmoney [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- new money;
- money = GetPlayerMoney(giveplayerid);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(string, sizeof(string), "$%d - %s[ID:%d].",money,giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[un/Mute Commands]----------------------------------------|
- if(strcmp(cmd, "/mute", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Mute [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsAdmin(giveplayerid))
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Mute an Admin !");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- AdminModePlayerInfo[giveplayerid][Mute] = 1;
- format(string, sizeof(string), "You Muted %s[ID:%d].",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been Muted By Admin %s[ID:%d].",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s Muted by Admin %s",giveplayername ,sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unmute", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /unMute [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- AdminModePlayerInfo[giveplayerid][Mute] = 0;
- format(string, sizeof(string), "You unMuted %s[ID:%d].",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been unMuted By Admin %s[ID:%d].",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s unMuted by Admin %s",giveplayername ,sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[ClearChat Command]----------------------------------------|
- if(strcmp(cmd, "/clearchat", true) == 0 || strcmp(cmd, "/cc", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
- format(string, sizeof(string), "Chat Cleared by Admin %s[ID:%d]", sendername, playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Kick/Ban Commands]----------------------------------------|
- if(strcmp(cmd, "/kick", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kick [Playerid/PartOfName] [Reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kick [Playerid/PartOfName] [Reason]");
- return 1;
- }
- new Year, Month, Day, Hours, Minutes, Seconds;
- gettime(Hours, Minutes,Seconds);
- getdate(Year, Month, Day);
- format(string, sizeof(string), "You kicked By Admin %s[ID:%d], reason: %s", sendername, playerid, (result));
- SendClientMessageNoAFK(giveplayerid,COLOR_M, string);
- Kick(giveplayerid);
- format(string, sizeof(string), "%s kicked By Admin %s[ID:%d], reason: %s", giveplayername, sendername, playerid, (result));
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- format(string, sizeof(string), "%s Kicked By Admin %s, reason: %s Date:(%d/%d/%d) Time:(%d:%d:%d)", giveplayername, sendername, (result), Day, Month, Year, Hours, Minutes, Seconds);
- KickLog(string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/kickall", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kickall [Reason]");
- return 1;
- }
- format(string, sizeof(string), "Admin %s[ID:%d] Kicked all Players, reason: %s",sendername, playerid, (result));
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!IsAdmin(playerid))
- {
- Kick(i);
- }
- }
- }
- new Year, Month, Day, Hours, Minutes, Seconds;
- gettime(Hours, Minutes, Seconds);
- getdate(Year, Month, Day);
- format(string, sizeof(string), "Admin %s Kicked All Players, reason: %s Date:(%d/%d/%d) Time:(%d:%d)", sendername, (result),Year, Month, Day, Hours, Minutes);
- KickLog(string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/ban", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Ban [Playerid/PartOfName] [Reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Ban [Playerid/PartOfName] [Reason]");
- return 1;
- }
- new IP[16];
- GetPlayerIp(giveplayerid, IP, sizeof(IP));
- format(string, sizeof(string), "You Banned By Admin %s[ID:%d], reason: %s", sendername,playerid, (result));
- SendClientMessageNoAFK(giveplayerid,COLOR_M, string);
- BanEx(giveplayerid,(result));
- format(string, sizeof(string), "%s Banned By Admin %s[ID:%d], reason: %s", giveplayername, sendername, playerid, (result));
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- new Year, Month, Day, Hours, Minutes, Seconds;
- getdate(Year, Month, Day);
- gettime(Hours, Minutes, Seconds);
- format(string, sizeof(string), "%s Banned By Admin %s, reason: %s Date:(%d/%d/%d) Time:(%d:%d) IP:(%s)", giveplayername, sendername, (result), Day, Month, Year, Hours, Minutes, IP);
- BanLog(string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unban", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /unBan [IP Adress]");
- return 1;
- }
- format(string,sizeof(string),"unbanip %s",(result));
- SendRconCommand(string);
- format(string, sizeof(string), "|%s| IP unBanned.",(result));
- SendClientMessage(playerid,COLOR_M,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Kill Command]----------------------------------------|
- if(strcmp(cmd, "/kill", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kill [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Killed By Admin %s[ID:%d]", giveplayername, sendername, playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- SetPlayerHealth(giveplayerid,0);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[un/Spec Command]----------------------------------------|
- if(strcmp(cmd, "/spec", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Spec [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- new Specvehicleid = GetPlayerVehicleID(giveplayerid);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(string, sizeof(string), "Spectating %s[ID:%d](In Vehicle).", giveplayername, giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectateVehicle(playerid, Specvehicleid);
- AdminModePlayerInfo[playerid][Spector] = 1;
- return 1;
- }
- else
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(string, sizeof(string), "Spectating %s[ID:%d].", giveplayername, giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, giveplayerid);
- AdminModePlayerInfo[playerid][Spector] = 1;
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unspec", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- if(AdminModePlayerInfo[playerid][Spector] == 1)
- {
- SendClientMessageNoAFK(playerid,COLOR_M, "unSpectated.");
- TogglePlayerSpectating(playerid, 0);
- AdminModePlayerInfo[playerid][Spector] = 0;
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You Are not Spectating Someone!");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Admin Message Commands]----------------------------------------|
- if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Admin [Text]");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "~w~%s: ~b~%s", sendername, result);
- GameTextForAllNoAFK(string, 5000, 6);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/adminchat", true) == 0 || strcmp(cmd, "/ac", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /AdminChat [Text]");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin %s[ID:%d]: %s", sendername, playerid, result);
- SendAdminMessage(COLOR_CHATADMIN, string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Admin Restart Command]----------------------------------------|
- if(strcmp(cmd, "/restart", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin %s is Restarting the Mode.", sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- GameModeExit();
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[AFK Command]----------------------------------------|
- if(strcmp(cmd, "/afk", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(AdminModePlayerInfo[playerid][AFK] == 0)
- {
- new AFKname[256];
- GetPlayerName(playerid, AFKname, sizeof(AFKname));
- format(string, sizeof(string), "%s is now in AFK Mode.", AFKname);
- SendClientMessageToAllNoAFK(COLOR_AFK, string);
- AdminModePlayerInfo[playerid][AFK] = 1;
- format(string, sizeof(string), "[AFK]%s", AFKname);
- SetPlayerName(playerid, string);
- TogglePlayerControllable(playerid, 0);
- TextDrawShowForPlayer(playerid,AFKBox);
- TextDrawShowForPlayer(playerid,AFKText);
- TextDrawShowForPlayer(playerid,AFKTextReturn);
- SetPlayerVirtualWorld(playerid,playerid+1);
- return 1;
- }
- else if(AdminModePlayerInfo[playerid][AFK] == 1)
- {
- AdminModePlayerInfo[playerid][AFK] = 0;
- new AFKname[256];
- GetPlayerName(playerid, AFKname, sizeof(AFKname));
- strdel(AFKname, 0, 5);
- format(string, sizeof(string), "%s", AFKname);
- SetPlayerName(playerid, string);
- TogglePlayerControllable(playerid, 1);
- format(string, sizeof(string), "%s is back from AFK Mode.", AFKname);
- SendClientMessageToAllNoAFK(COLOR_AFK, string);
- TextDrawHideForPlayer(playerid,AFKBox);
- TextDrawHideForPlayer(playerid,AFKText);
- TextDrawHideForPlayer(playerid,AFKTextReturn);
- SetPlayerVirtualWorld(playerid,0);
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Count Commands]----------------------------------------|
- if(strcmp(cmd, "/count", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Count [Time(Seconds)]");
- return 1;
- }
- new time;
- time = strval(tmp);
- if(CountStatus == 0)
- {
- new AdminName[256];
- GetPlayerName(playerid,AdminName,sizeof(AdminName));
- GameTextForAllNoAFK("~g~Count Started", 1500, 3);
- format(string, sizeof(string), "Count Activated for: %d Seconds.",time);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "Admin %s Activated Count for: %d Seconds.", AdminName, time);
- SendAdminMessage(COLOR_M, string);
- CountStatus = 1;
- SetCount(time);
- Count = SetTimer("CountTimer",Second,1);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "Count Already Activate !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- }
- if(strcmp(cmd, "/cancelcount", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- if(CountStatus == 1)
- {
- new AdminName[256];
- GetPlayerName(playerid,AdminName,sizeof(AdminName));
- format(string, sizeof(string), "Admin %s Canceled the Count.", AdminName);
- SendAdminMessage(COLOR_M, string);
- GameTextForAllNoAFK("~r~Count Canceled!", 1500, 3);
- SendClientMessageNoAFK(playerid,COLOR_M,"Count Canceled.");
- CountStatus = 0;
- KillTimer(Count);
- KillTimer(CountGo);
- CountTime = 0;
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "Count didn't Activate !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- }
- //----------------------------------------[Admins Commands]----------------------------------------|
- if(strcmp(cmd, "/admins", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new AdminsCount = 0;
- SendClientMessage(playerid, COLOR_ADMINS, "Admins Online:");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsAdmin(i))
- {
- new AdminName[256];
- GetPlayerName(i,AdminName,sizeof(AdminName));
- format(string,sizeof(string),"Admin %s",AdminName);
- SendClientMessage(playerid, COLOR_ADMINS, string);
- AdminsCount += 1;
- }
- }
- }
- if(AdminsCount == 0)
- {
- SendClientMessage(playerid, COLOR_ADMINS, "None.");
- }
- else if(AdminsCount == 1)
- {
- SendClientMessage(playerid, COLOR_ADMINS, "Total: 1 Admin Online.");
- }
- else
- {
- format(string,sizeof(string),"Total: %d Admins Online.",AdminsCount);
- SendClientMessage(playerid, COLOR_ADMINS, string);
- }
- return 1;
- }
- return 1;
- }
- if(strcmp(cmd, "/adminlogin", true) == 0 || strcmp(cmd, "/al", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- AdminModePlayerInfo[playerid][PlayerLogin] = 1;
- ShowAdministrationLoginStep(playerid,1);
- return 1;
- }
- return 1;
- }
- //----------------------------------------[Vehicle Commands]----------------------------------------|
- if(strcmp(cmd, "/createvehicle", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Createvehicle [Vehicle Model] [Color 1] [Color 2]");
- return 1;
- }
- new VehicleModel;
- VehicleModel = strval(tmp);
- if(VehicleModel < 400 || VehicleModel > 611)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Vehicle Model can be Between 400 to 611 !");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Createvehicle [Vehicle Model] [Color 1] [Color 2]");
- return 1;
- }
- new Color1;
- Color1 = strval(tmp);
- if(Color1 < 0 || Color1 > 126)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Vehicle Colors can be Between 0 to 126 ! (Color1)");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Createvehicle [Vehicle Model] [Color 1] [Color 2]");
- return 1;
- }
- new Color2;
- Color2 = strval(tmp);
- if(Color2 < 0 || Color2 > 126)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Vehicle Colors can be Between 0 to 126 ! (Color2)");
- return 1;
- }
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- CreateVehicle(VehicleModel, X,Y,Z+5, 0.0, Color1, Color2, 300000);//Spawn after 5 Minutes back.
- SendClientMessageNoAFK(playerid, COLOR_M, "Vehicle Spawned.");
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/spawnvehicle", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Spawnvehicle [Vehicle ID]");
- return 1;
- }
- new VehicleID;
- VehicleID = strval(tmp);
- new Float:VehicleX,Float:VehicleY,Float:VehicleZ;
- GetVehiclePos(VehicleID, VehicleX,VehicleY,VehicleZ);
- SetPlayerPos(playerid, VehicleX,VehicleY,VehicleZ+5);
- format(string, sizeof(string), "You Spawned to Vehicle %d.",VehicleID);
- SendClientMessageNoAFK(playerid, COLOR_M, string);
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Weather Commands]----------------------------------------|
- if(strcmp(cmd, "/weather", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Weather [Weather ID]");
- return 1;
- }
- new WeatherID;
- WeatherID = strval(tmp);
- format(string, sizeof(string), "You Changed Weather to Weather ID - %d.",WeatherID);
- SendClientMessageNoAFK(playerid, COLOR_M, string);
- SetWeather(WeatherID);
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/setweather", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetWeather [Playerid/PartOfName] [Weather ID]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetWeather [Playerid/PartOfName] [Weather ID]");
- return 1;
- }
- new WeatherID;
- WeatherID = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(string, sizeof(string), "You Changed %s[ID:%d] Weather to Weather ID - %d.",giveplayername ,giveplayerid ,WeatherID);
- SendClientMessageNoAFK(playerid, COLOR_M, string);
- SetPlayerWeather(giveplayerid,WeatherID);
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Time Commands]----------------------------------------|
- if(strcmp(cmd, "/time", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /time [Time(Hours)]");
- return 1;
- }
- new Time;
- Time = strval(tmp);
- format(string, sizeof(string), "You Changed Time to %d:00.",Time);
- SendClientMessageNoAFK(playerid, COLOR_M, string);
- SetTime(Time);
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/settime", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetTime [Playerid/PartOfName] [Time(Hours)]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetTime [Playerid/PartOfName] [Time(Hours)]");
- return 1;
- }
- new Time;
- Time = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(string, sizeof(string), "You Changed %s[ID:%d] Time to %d:00.",giveplayername ,giveplayerid ,Time);
- SendClientMessageNoAFK(playerid, COLOR_M, string);
- SetPlayerTime(giveplayerid,Time,00);
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Weapon Commands]----------------------------------------|
- if(strcmp(cmd, "/giveweapon", true) == 0 || strcmp(cmd, "/gw", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
- return 1;
- }
- new WeaponID;
- WeaponID = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
- return 1;
- }
- if(WeaponID < 1 || WeaponID > 46)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Weapon ID Must be between 1 - 46.");
- return 1;
- }
- if(WeaponID == 38)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Minigun - unAvailable Weapon.");
- return 1;
- }
- if(WeaponID == 39)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Satchel Charge - unAvailable Weapon.");
- return 1;
- }
- if(WeaponID == 40)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Detonator - unAvailable Weapon.");
- return 1;
- }
- if(WeaponID == 43)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Camera - unAvailable Weapon.");
- return 1;
- }
- if(WeaponID == 44)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Nightvision Goggles - unAvailable Weapon.");
- return 1;
- }
- if(WeaponID == 45)
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Infrared Vision - unAvailable Weapon.");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
- return 1;
- }
- new WeaponName[256];
- new BulletsAmount;
- BulletsAmount = strval(tmp);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GivePlayerWeapon(giveplayerid,WeaponID,BulletsAmount);
- GetWeaponName(WeaponID, WeaponName, 64);
- format(string, sizeof(string), "You Gave %s[ID:%d] Weapon:%s Bullets:%d.",giveplayername,giveplayerid,WeaponName,BulletsAmount);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You Got Weapon:%s Bullets:%d from Admin %s[ID:%d].",WeaponName,BulletsAmount,sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/disarm", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Disarm [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid == playerid)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessageNoAFK(playerid,COLOR_M,"You Disarmed Yourself.");
- format(string, sizeof(string), "Admin %s Disarmed by himself.",sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- if(IsAdmin(giveplayerid))
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Disarm an Admin !");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "You Disarmed %s[ID:%d].",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been Disarmed By Admin %s[ID:%d].",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s Disarmed by Admin %s",giveplayername ,sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- ResetPlayerWeapons(giveplayerid);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/disarmall", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- ResetPlayerWeapons(i);
- }
- }
- format(string, sizeof(string), "Admin %s[ID:%d] Disarmed all Players.",sendername,playerid);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Chat on/off Command]----------------------------------------|
- if(strcmp(cmd, "/chatstatus", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- if(ChatStatus == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin %s Closed the Chat.", sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- ChatStatus = 1;
- return 1;
- }
- else
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin %s Opened the Chat.", sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
- ChatStatus = 0;
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[IP Command]----------------------------------------|
- if(strcmp(cmd, "/getip", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GetIP [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new IP[16];
- GetPlayerIp(giveplayerid, IP, sizeof(IP));
- format(string, sizeof(string), "The IP of %s[ID:%d] is |%s|.", giveplayername, giveplayerid, IP);
- SendClientMessageNoAFK(playerid,COLOR_M, string);
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- //----------------------------------------[JetPack Command]----------------------------------------|
- if(strcmp(cmd, "/jetpack", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
- SendClientMessageNoAFK(playerid,COLOR_M, "You got a JetPack.");
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- }
- }
- return 1;
- }
- //----------------------------------------[Clock Command]----------------------------------------|
- if(strcmp(cmd, "/clock", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(AdminModePlayerInfo[playerid][ClockStatus] == 0)
- {
- TextDrawShowForPlayer(playerid, Clock);
- SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Clock Revealed.");
- AdminModePlayerInfo[playerid][ClockStatus] = 1;
- return 1;
- }
- else
- {
- TextDrawHideForPlayer(playerid, Clock);
- SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Clock Hid.");
- AdminModePlayerInfo[playerid][ClockStatus] = 0;
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Date Command]----------------------------------------|
- if(strcmp(cmd, "/date", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(AdminModePlayerInfo[playerid][DateStatus] == 0)
- {
- TextDrawShowForPlayer(playerid, Date);
- SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Date Revealed.");
- AdminModePlayerInfo[playerid][DateStatus] = 1;
- return 1;
- }
- else
- {
- TextDrawHideForPlayer(playerid, Date);
- SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Date Hid.");
- AdminModePlayerInfo[playerid][DateStatus] = 0;
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Location Command]----------------------------------------|
- if(strcmp(cmd, "/location", true) == 0 ||strcmp(cmd, "/l", true) == 0 )
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Location [Save/Spawn]");
- return 1;
- }
- new Choose[256];
- strmid(Choose, tmp, 0, strlen(cmdtext), 255);
- if(strcmp(Choose,"save",true) == 0)//Save Position/Location
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid,X,Y,Z);
- AdminModePlayerInfo[playerid][LocationX] = X;
- AdminModePlayerInfo[playerid][LocationY] = Y;
- AdminModePlayerInfo[playerid][LocationZ] = Z;
- SendClientMessageNoAFK(playerid, COLOR_M, "Location/Position Saved.");
- return 1;
- }
- else if(strcmp(Choose,"spawn",true) == 0)//Spawn to Position/Location
- {
- if(!(AdminModePlayerInfo[playerid][LocationX] == 0 && AdminModePlayerInfo[playerid][LocationY] == 0 && AdminModePlayerInfo[playerid][LocationZ] == 0))
- {
- SetPlayerPos(playerid,AdminModePlayerInfo[playerid][LocationX],AdminModePlayerInfo[playerid][LocationY],AdminModePlayerInfo[playerid][LocationZ]);
- SendClientMessageNoAFK(playerid, COLOR_M, "You Teleported to your Location/Position.");
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You didn't save Location/Position!");
- return 1;
- }
- }
- else
- {
- format(string,sizeof(string),"Unknown Choose (%s).",Choose);
- SendClientMessageNoAFK(playerid, COLOR_W,string);
- SendClientMessageNoAFK(playerid, COLOR_W, "Form| /Location [Save/Spawn]");
- }
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Jail Commands]----------------------------------------|
- if(strcmp(cmd, "/jail", true) == 0 || strcmp(cmd, "/j", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Jail [Playerid/PartOfName] [Minutes(1-30)] [Reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsAdmin(giveplayerid))
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Jail an Admin !");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Jail [Playerid/PartOfName] [Minutes(1-30)] [Reason]");
- return 1;
- }
- new JailTime;
- JailTime = strval(tmp);
- if(JailTime <= 30 && JailTime >= 1)
- {
- 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))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Jail [Playerid/PartOfName] [Minutes(1-30)] [Reason]");
- return 1;
- }
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- AdminModePlayerInfo[giveplayerid][JailStatus] = 1;
- AdminModePlayerInfo[giveplayerid][JailMinutes] = JailTime-1;
- AdminModePlayerInfo[giveplayerid][JailSeconds] = 60;
- format(string, sizeof(string), "You Jailed %s[ID:%d] for %d Minutes with Reason:%s.",giveplayername,giveplayerid,JailTime,(result));
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been Jailed By Admin %s[ID:%d] for %d Minutes, Reason:%s.",sendername,playerid,JailTime,(result));
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s Jailed by Admin %s for %d Minutes, Reason:%s",giveplayername , sendername, JailTime, (result));
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- TextDrawShowForPlayer(giveplayerid,TextJail);
- format(string, sizeof(string), "%d:00 ~g~Min",JailTime);
- TextDrawSetString(TimeJail[giveplayerid],string);
- TextDrawShowForPlayer(giveplayerid,TimeJail[giveplayerid]);
- SetPlayerInterior(giveplayerid, 3);
- SetPlayerPos(giveplayerid, 197.7777,174.6500,1003.0234);
- ResetPlayerWeapons(giveplayerid);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Jail Time(Minutes) must be Between 1 to 30!");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/unjail", true) == 0 || strcmp(cmd, "/unj", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /unJail [Playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(AdminModePlayerInfo[giveplayerid][JailStatus] == 1)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- TextDrawHideForPlayer(giveplayerid,TimeJail[giveplayerid]);
- TextDrawSetString(TimeJail[giveplayerid],"00:00 ~g~Min");
- TextDrawHideForPlayer(giveplayerid,TextJail);
- AdminModePlayerInfo[giveplayerid][JailStatus] = 0;
- AdminModePlayerInfo[giveplayerid][JailMinutes] = 0;
- AdminModePlayerInfo[giveplayerid][JailSeconds] = 0;
- SpawnPlayer(giveplayerid);
- format(string, sizeof(string), "You unJailed %s[ID:%d].",giveplayername,giveplayerid);
- SendClientMessageNoAFK(playerid,COLOR_M,string);
- format(string, sizeof(string), "You have been Jailed By Admin %s[ID:%d]",sendername,playerid);
- SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
- format(string, sizeof(string), "%s unJailed by Admin %s",giveplayername , sendername);
- SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player isn't in Jail!");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
- return 1;
- }
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------------[Admin Help Command]----------------------------------------|
- if(strcmp(cmd, "/adminhelp", true) == 0 ||strcmp(cmd, "/ah", true) == 0 )
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Adminhelp [Category]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "|Categories|");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "<Chat> <Interior> <Teleport> <Freeze> <Spec>");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "<Armor> <Skin> <Money> <Mute> <Kick> <Jetpack>");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "<Kill> <Weapon> <HP> <Time> <Ban> <IP> <Jail>");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "<Vehicle> <Weather> <AdminCmd> <Restart> <Count>");
- return 1;
- }
- new Category[256];
- strmid(Category, tmp, 0, strlen(cmdtext), 255);
- if(strcmp(Category,"chat",true) == 0)//Chat Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Clearchat (/cc) [Clears Global Chat]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Chatstatus [Close/Open Global Chat]");
- return 1;
- }
- else if(strcmp(Category,"interior",true) == 0)//Interior Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setinterior [Sets Player Interior]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Getinterior [Gets Player Interior]");
- }
- else if(strcmp(Category,"teleport",true) == 0)//Teleport Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tpto [Teleports you to Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tphere [Teleports Player to you]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tphereall [Teleports all Players to you]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tptp [Teleports player to player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Location (/l) [Saves/Spawns you to your Location]");
- }
- else if(strcmp(Category,"freeze",true) == 0)//Freeze Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Freeze (/f) [Freezes Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/unFreeze (/unf) [unFreezes Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Freezeall (/fa) [Freezes all Players]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/unFreezeall (/unfa) [unFreezes all Players]");
- }
- else if(strcmp(Category,"spec",true) == 0)//Spec Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Spec [Spectating Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/unSpec [unSpectating]");
- }
- else if(strcmp(Category,"hp",true) == 0)//HP Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Sethp [Sets HP to Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Hp [Raises HP to all]");
- }
- else if(strcmp(Category,"armor",true) == 0)//Armor Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setarmor [Sets Armour to Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Armor [Raises Armour to all]");
- }
- else if(strcmp(Category,"skin",true) == 0)//Skin Command
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setskin [Sets Skin to Player]");
- }
- else if(strcmp(Category,"money",true) == 0)//Money Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setmoney [Sets Money to Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Givemoney [Gives Money to Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Takemoney [Takes Money from Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Checkmoney [Checks Player Money]");
- }
- else if(strcmp(Category,"mute",true) == 0)//Mute Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Mute [Mutes Player(Can't talk in Global chat)]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/unMute [unMutes Player(Can talk in Global chat)]");
- }
- else if(strcmp(Category,"kick",true) == 0)//Kick Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Kick [Kicks Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Kickall [Kicks all Players(not Admins)]");
- return 1;
- }
- else if(strcmp(Category,"kill",true) == 0)//Kill Command
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Kill [Kills Player]");
- }
- else if(strcmp(Category,"vehicle",true) == 0)//Vehicle Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Fixvehicle [fixes Player Vehicle]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Createvehicle [Create a new Vehicle]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Spawnvehicle [Spawns you to Vehicle(ID)]");
- }
- else if(strcmp(Category,"count",true) == 0)//Count Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Count [Starts Count]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Cancelcount [Cancels Count]");
- }
- else if(strcmp(Category,"time",true) == 0)//Time Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Time [Sets Global Time]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/SetTime [Sets Player Time]");
- }
- else if(strcmp(Category,"ban",true) == 0)//Ban Command
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Ban [Bans Player IP]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/unBan [unBans Player IP]");
- }
- else if(strcmp(Category,"weapon",true) == 0)//Weapon Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Giveweapon [Gives Weapon to Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Disarm [Disarms player(Resets Weapons)]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Disarmall [Disarms all Players(Resets Weapons)]");
- }
- else if(strcmp(Category,"weather",true) == 0)//Weather Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Weather [Sets Global Weather]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/SetWeather [Sets Player Weather]");
- }
- else if(strcmp(Category,"admincmd",true) == 0)//AdminCmd Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/adminchat (/ac) [Admins Chat]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/admin (/a) [Shows a Admin message on the Screen]");
- }
- else if(strcmp(Category,"restart",true) == 0)//Restart Command
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Restart [Restarts GameMode]");
- }
- else if(strcmp(Category,"ip",true) == 0)//IP Command
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/GetIp [Gets Player IP]");
- }
- else if(strcmp(Category,"jetpack",true) == 0)//JetPack Command
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/JetPack [Gives JackPack to you.]");
- }
- else if(strcmp(Category,"jail",true) == 0)//Jail Commands
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/Jail (/j) [Jails Player]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/unJail (/unj) [unJails Player]");
- }
- else
- {
- format(string,sizeof(string),"Unknown Category (%s).",Category);
- SendClientMessageNoAFK(playerid, COLOR_W,string);
- }
- return 1;
- }
- else
- {
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/afk [Become AFK/Back from AFK]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/adminlogin (/al) [Login as Admin]");
- SendClientMessageNoAFK(playerid, COLOR_HELP, "/admins [Admins Online]");
- return 1;
- }
- }
- return 1;
- }
- format(string,sizeof(string),"Unknown Command (%s).",cmdtext);
- return SendClientMessage(playerid,COLOR_W,string);
- }
- else
- {
- //----------------------------------------[AFK Commands]----------------------------------------|
- if(strcmp(cmd, "/afk", true) == 0)
- {
- AdminModePlayerInfo[playerid][AFK] = 0;
- new AFKname[256];
- GetPlayerName(playerid, AFKname, sizeof(AFKname));
- strdel(AFKname, 0, 5);
- format(string, sizeof(string), "%s", AFKname);
- SetPlayerName(playerid, string);
- TogglePlayerControllable(playerid, 1);
- format(string, sizeof(string), "%s is back from AFK Mode.", AFKname);
- SendClientMessageToAllNoAFK(COLOR_AFK, string);
- TextDrawHideForPlayer(playerid,AFKBox);
- TextDrawHideForPlayer(playerid,AFKText);
- TextDrawHideForPlayer(playerid,AFKTextReturn);
- SetPlayerVirtualWorld(playerid,0);
- return 1;
- }
- return SendClientMessage(playerid, COLOR_W, "You Are AFK,You can't Write nothing!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment