Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*x---------------------------------Important-------------------------------------x*/
- //**INCLUDES**//
- #include <a_samp>
- #include <md5>
- #include <seif_cursor>
- //**MISC**//
- /*x---------------------------------Defining-------------------------------------x*/
- //**COLORS*//
- #define GREEN 0x21DD00FF
- #define RED 0xE60000FF
- #define ADMIN_RED 0xFB0000FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define LIGHTBLUE 0x00C2ECFF
- #define PURPLE 0xB360FDFF
- #define BLUE 0x1229FAFF
- #define LIGHTGREEN 0x38FF06FF
- #define DARKPINK 0xE100E1FF
- #define DARKGREEN 0x008040FF
- #define AQUAGREEN 0x00CACAFB
- #define NICESKY 0x99FFFFAA
- #define GREY 0xCECECEFF
- #define WHITE 0xFFFFFFFF
- //**MISC**//
- //#define LOGIN_BEFORE_SPAWN // If uncommented, players will have to login before spawning if their account exists. If commented, they can spawn without logging in.
- //#define ENABLE_AUTO_LOGIN // LEAVE IT COMMENTED(BUGGED) -- Allows you to auto-login when you connect if you had the same IP as previous login.
- #define LOGIN_DELAY 3 // Seconds. Default = 3 seconds
- //**VARIABLES**//
- enum Info
- {
- AdminLevel,
- Password[128],
- Cash,
- Warns,
- Jail,
- Logged,
- Mute,
- WarnReason1[128],
- WarnReason2[128],
- WarnReason3[128],
- IP[20],
- };
- new ViewCommands[2][128] = // 2 = amount of commands to view
- {
- {"/admins"},
- {"/count"}
- };
- new VehNames[212][] = { // Vehicle Names - Betamaster
- {"Landstalker"},
- {"Bravura"},
- {"Buffalo"},
- {"Linerunner"},
- {"Perrenial"},
- {"Sentinel"},
- {"Dumper"},
- {"Firetruck"},
- {"Trashmaster"},
- {"Stretch"},
- {"Manana"},
- {"Infernus"},
- {"Voodoo"},
- {"Pony"},
- {"Mule"},
- {"Cheetah"},
- {"Ambulance"},
- {"Leviathan"},
- {"Moonbeam"},
- {"Esperanto"},
- {"Taxi"},
- {"Washington"},
- {"Bobcat"},
- {"Mr Whoopee"},
- {"BF Injection"},
- {"Hunter"},
- {"Premier"},
- {"Enforcer"},
- {"Securicar"},
- {"Banshee"},
- {"Predator"},
- {"Bus"},
- {"Rhino"},
- {"Barracks"},
- {"Hotknife"},
- {"Trailer 1"}, //artict1
- {"Previon"},
- {"Coach"},
- {"Cabbie"},
- {"Stallion"},
- {"Rumpo"},
- {"RC Bandit"},
- {"Romero"},
- {"Packer"},
- {"Monster"},
- {"Admiral"},
- {"Squalo"},
- {"Seasparrow"},
- {"Pizzaboy"},
- {"Tram"},
- {"Trailer 2"}, //artict2
- {"Turismo"},
- {"Speeder"},
- {"Reefer"},
- {"Tropic"},
- {"Flatbed"},
- {"Yankee"},
- {"Caddy"},
- {"Solair"},
- {"Berkley's RC Van"},
- {"Skimmer"},
- {"PCJ-600"},
- {"Faggio"},
- {"Freeway"},
- {"RC Baron"},
- {"RC Raider"},
- {"Glendale"},
- {"Oceanic"},
- {"Sanchez"},
- {"Sparrow"},
- {"Patriot"},
- {"Quad"},
- {"Coastguard"},
- {"Dinghy"},
- {"Hermes"},
- {"Sabre"},
- {"Rustler"},
- {"ZR-350"},
- {"Walton"},
- {"Regina"},
- {"Comet"},
- {"BMX"},
- {"Burrito"},
- {"Camper"},
- {"Marquis"},
- {"Baggage"},
- {"Dozer"},
- {"Maverick"},
- {"News Chopper"},
- {"Rancher"},
- {"FBI Rancher"},
- {"Virgo"},
- {"Greenwood"},
- {"Jetmax"},
- {"Hotring"},
- {"Sandking"},
- {"Blista Compact"},
- {"Police Maverick"},
- {"Boxville"},
- {"Benson"},
- {"Mesa"},
- {"RC Goblin"},
- {"Hotring Racer A"}, //hotrina
- {"Hotring Racer B"}, //hotrinb
- {"Bloodring Banger"},
- {"Rancher"},
- {"Super GT"},
- {"Elegant"},
- {"Journey"},
- {"Bike"},
- {"Mountain Bike"},
- {"Beagle"},
- {"Cropdust"},
- {"Stunt"},
- {"Tanker"}, //petro
- {"Roadtrain"},
- {"Nebula"},
- {"Majestic"},
- {"Buccaneer"},
- {"Shamal"},
- {"Hydra"},
- {"FCR-900"},
- {"NRG-500"},
- {"HPV1000"},
- {"Cement Truck"},
- {"Tow Truck"},
- {"Fortune"},
- {"Cadrona"},
- {"FBI Truck"},
- {"Willard"},
- {"Forklift"},
- {"Tractor"},
- {"Combine"},
- {"Feltzer"},
- {"Remington"},
- {"Slamvan"},
- {"Blade"},
- {"Freight"},
- {"Streak"},
- {"Vortex"},
- {"Vincent"},
- {"Bullet"},
- {"Clover"},
- {"Sadler"},
- {"Firetruck LA"}, //firela
- {"Hustler"},
- {"Intruder"},
- {"Primo"},
- {"Cargobob"},
- {"Tampa"},
- {"Sunrise"},
- {"Merit"},
- {"Utility"},
- {"Nevada"},
- {"Yosemite"},
- {"Windsor"},
- {"Monster A"}, //monstera
- {"Monster B"}, //monsterb
- {"Uranus"},
- {"Jester"},
- {"Sultan"},
- {"Stratum"},
- {"Elegy"},
- {"Raindance"},
- {"RC Tiger"},
- {"Flash"},
- {"Tahoma"},
- {"Savanna"},
- {"Bandito"},
- {"Freight Flat"}, //freiflat
- {"Streak Carriage"}, //streakc
- {"Kart"},
- {"Mower"},
- {"Duneride"},
- {"Sweeper"},
- {"Broadway"},
- {"Tornado"},
- {"AT-400"},
- {"DFT-30"},
- {"Huntley"},
- {"Stafford"},
- {"BF-400"},
- {"Newsvan"},
- {"Tug"},
- {"Trailer 3"}, //petrotr
- {"Emperor"},
- {"Wayfarer"},
- {"Euros"},
- {"Hotdog"},
- {"Club"},
- {"Freight Carriage"}, //freibox
- {"Trailer 3"}, //artict3
- {"Andromada"},
- {"Dodo"},
- {"RC Cam"},
- {"Launch"},
- {"Police Car (LSPD)"},
- {"Police Car (SFPD)"},
- {"Police Car (LVPD)"},
- {"Police Ranger"},
- {"Picador"},
- {"S.W.A.T. Van"},
- {"Alpha"},
- {"Phoenix"},
- {"Glendale"},
- {"Sadler"},
- {"Luggage Trailer A"}, //bagboxa
- {"Luggage Trailer B"}, //bagboxb
- {"Stair Trailer"}, //tugstair
- {"Boxville"},
- {"Farm Plow"}, //farmtr1
- {"Utility Trailer"} //utiltr1
- };
- new WeapNames[][32] = {
- {"Unarmed (Fist)"}, // 0
- {"Brass Knuckles"}, // 1
- {"Golf Club"}, // 2
- {"Night Stick"}, // 3
- {"Knife"}, // 4
- {"Baseball Bat"}, // 5
- {"Shovel"}, // 6
- {"Pool Cue"}, // 7
- {"Katana"}, // 8
- {"Chainsaw"}, // 9
- {"Purple Dildo"}, // 10
- {"Big White Vibrator"}, // 11
- {"Medium White Vibrator"}, // 12
- {"Small White Vibrator"}, // 13
- {"Flowers"}, // 14
- {"Cane"}, // 15
- {"Grenade"}, // 16
- {"Teargas"}, // 17
- {"Molotov"}, // 18
- {" "}, // 19
- {" "}, // 20
- {" "}, // 21
- {"Colt 45"}, // 22
- {"Colt 45(Silenced)"}, // 23
- {"Deagle"}, // 24
- {"Normal Shotgun"}, // 25
- {"Sawnoff Shotgun"}, // 26
- {"Combat Shotgun"}, // 27
- {"Micro Uzi(Mac 10)"}, // 28
- {"SMG(MP5)"}, // 29
- {"AK47"}, // 30
- {"M4"}, // 31
- {"Tec9"}, // 32
- {"Country Rifle"}, // 33
- {"Sniper Rifle"}, // 34
- {"Rocket Launcher"}, // 35
- {"Heat-Seeking Rocket Launcher"}, // 36
- {"Flamethrower"}, // 37
- {"Minigun"}, // 38
- {"Satchel Charge"}, // 39
- {"Detonator"}, // 40
- {"Spray Can"}, // 41
- {"Fire Extinguisher"}, // 42
- {"Camera"}, // 43
- {"Night Vision Goggles"}, // 44
- {"Infrared Vision Goggles"}, // 45
- {"Parachute"}, // 46
- {"Fake Pistol"} // 47
- };
- new AccountInfo[MAX_PLAYERS][Info];
- new SuperPunch[MAX_PLAYERS];
- new ViewCmds[MAX_PLAYERS];
- new Count = 999;
- new Hide[MAX_PLAYERS];
- new Drugs[MAX_PLAYERS];
- new bool:PMBlock[MAX_PLAYERS];
- new Nuke[MAX_PLAYERS];
- new Missile[MAX_PLAYERS];
- new bool:MenuShown[MAX_PLAYERS];
- new PassBox[MAX_PLAYERS][128];
- new PassClickBox;
- new PassClickBox_Fail;
- new PassClickBox_Suc;
- new PassClickBox_Reg;
- new Text:Login;
- new Text:Nick;
- new Text:PasswordKey;
- new Text:Name[MAX_PLAYERS];
- new Text:Pass[MAX_PLAYERS];
- //**FORWARDS**//
- forward SendClientMessageToAdmins(color,string[],alevel);
- forward OnPlayerRegister(playerid,password[]);
- forward OnPlayerLogin(playerid,password[]);
- forward OnPlayerUpdateAccount(playerid);
- forward BanLog(string[]);
- forward KickLog(string[]);
- forward VehicleLog(string[]);
- forward CountDown();
- forward ShowLoginMenu(playerid);
- forward HideLoginMenu(playerid);
- forward LogIn(playerid);
- /*x---------------------------------CallBacks-------------------------------------x*/
- stock strtok(const string[], &index,seperator=' ')
- {
- new length = strlen(string);
- new offset = index;
- new result[128];
- while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- if ((index < length) && (string[index] == seperator))
- {
- index++;
- }
- return result;
- }
- stock IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- if (string[i] > '9' || string[i] < '0')
- return 0;
- return 1;
- }
- ReturnUser(text[], playerid = INVALID_PLAYER_ID)
- {
- new pos = 0;
- while (text[pos] < 0x21)
- {
- if (text[pos] == 0) return INVALID_PLAYER_ID;
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if (IsNumeric(text[pos]))
- {
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS)
- {
- if(!IsPlayerConnected(userid))
- userid = INVALID_PLAYER_ID;
- else return userid;
- }
- }
- new len = strlen(text[pos]);
- new count = 0;
- new pname[MAX_PLAYER_NAME];
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- GetPlayerName(i, pname, sizeof (pname));
- if (strcmp(pname, text[pos], true, len) == 0)
- {
- if (len == strlen(pname)) return i;
- else
- {
- count++;
- userid = i;
- }
- }
- }
- }
- if (count != 1)
- {
- if (playerid != INVALID_PLAYER_ID)
- {
- if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
- else SendClientMessage(playerid, RED, "Playername not found.");
- }
- userid = INVALID_PLAYER_ID;
- }
- return userid;
- }
- stock GetFileString(string[])
- {
- new result[128];
- result[0] = 0;
- if (strfind(string, ":", true) == -1) return result;
- new id = strfind(string, ":", true);
- strmid(result, string, 0, id, 128);
- return result;
- }
- stock GetFileValue(string[])
- {
- new val[128];
- val[0] = 0;
- if (strfind(string , ":", true) == -1) return val;
- new id = strfind(string, ":", true);
- strmid(val, string, id+2, strlen(string), 128);
- return val;
- }
- public VehicleLog(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("vehiclespawn.log", io_append);
- if (hFile)
- {
- fwrite(hFile, entry);
- fclose(hFile);
- }
- }
- public KickLog(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("kick.log", io_append);
- if (hFile)
- {
- fwrite(hFile, entry);
- fclose(hFile);
- }
- }
- public BanLog(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("ban.log", io_append);
- if (hFile)
- {
- fwrite(hFile, entry);
- fclose(hFile);
- }
- }
- public SendClientMessageToAdmins(color,string[],alevel)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (AccountInfo[i][AdminLevel] >= alevel)
- {
- SendClientMessage(i, color, string);
- printf("%s", string);
- }
- }
- }
- return 1;
- }
- public OnPlayerRegister(playerid, password[])
- {
- if(IsPlayerConnected(playerid))
- {
- new name[MAX_PLAYER_NAME], str[128], ip[15];
- GetPlayerName(playerid, name, sizeof name);
- GetPlayerIp(playerid, ip, sizeof ip);
- format(str, sizeof str, "/sAccounts/%s.seifadmin", name);
- new File:account = fopen(str, io_write);
- if (account)
- {
- strmid(AccountInfo[playerid][Password], password, 0, strlen(password), 128);
- AccountInfo[playerid][Cash] = GetPlayerMoney(playerid);
- new file[128];
- {
- format(file, sizeof file, "Password: %s\n\r", AccountInfo[playerid][Password]);
- { fwrite(account, file); }
- format(file, sizeof file, "AdminLevel: %d\n\r",AccountInfo[playerid][AdminLevel]);
- { fwrite(account, file); }
- format(file, sizeof file, "Cash: %d\n\r", AccountInfo[playerid][Cash]);
- { fwrite(account, file); }
- format(file, sizeof file, "Warnings: %d\n\r",AccountInfo[playerid][Warns]);
- { fwrite(account, file); }
- format(file, sizeof file, "WarnReason1: %s\n\r",AccountInfo[playerid][WarnReason1]);
- { fwrite(account, file); }
- format(file, sizeof file, "WarnReason2: %s\n\r",AccountInfo[playerid][WarnReason2]);
- { fwrite(account, file); }
- format(file, sizeof file, "WarnReason3: %s\n\r",AccountInfo[playerid][WarnReason3]);
- { fwrite(account, file); }
- format(file, sizeof file, "IPAddress: %s\n\r",ip);
- { fwrite(account, file); }
- }
- fclose(account);
- HideButton(PassClickBox_Reg, playerid);
- ShowButton(PassClickBox, playerid);
- SendClientMessage(playerid, GREEN, "|- Account successfully registered. You can now login -|");
- }
- }
- return 1;
- }
- public OnPlayerUpdateAccount(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(AccountInfo[playerid][Logged] == 1)
- {
- new name[MAX_PLAYER_NAME], str[128];
- GetPlayerName(playerid, name, sizeof name);
- format(str, sizeof str, "/sAccounts/%s.seifadmin", name);
- new File:account = fopen(str, io_write);
- if (account)
- {
- AccountInfo[playerid][Cash] = GetPlayerMoney(playerid);
- new file[128];
- {
- format(file, sizeof file, "Password: %s\n\r", AccountInfo[playerid][Password]);
- { fwrite(account, file); }
- format(file, sizeof file, "AdminLevel: %d\n\r",AccountInfo[playerid][AdminLevel]);
- { fwrite(account, file); }
- format(file, sizeof file, "Cash: %d\n\r", AccountInfo[playerid][Cash]);
- { fwrite(account, file); }
- format(file, sizeof file, "Warnings: %d\n\r",AccountInfo[playerid][Warns]);
- { fwrite(account, file); }
- format(file, sizeof file, "WarnReason1: %s\n\r",AccountInfo[playerid][WarnReason1]);
- { fwrite(account, file); }
- format(file, sizeof file, "WarnReason2: %s\n\r",AccountInfo[playerid][WarnReason2]);
- { fwrite(account, file); }
- format(file, sizeof file, "WarnReason3: %s\n\r",AccountInfo[playerid][WarnReason3]);
- { fwrite(account, file); }
- format(file, sizeof file, "IPAddress: %s\n\r",AccountInfo[playerid][IP]);
- { fwrite(account, file); }
- }
- fclose(account);
- }
- }
- }
- return 1;
- }
- public OnPlayerLogin(playerid, password[])
- {
- new name[MAX_PLAYER_NAME], str[128];
- GetPlayerName(playerid, name, sizeof name);
- format(str, sizeof str, "/sAccounts/%s.seifadmin", name);
- new File:account = fopen(str, io_read);
- if (account)
- {
- new pass[256];
- new passres[128], value[128];
- fread(account, pass, sizeof pass);
- passres = GetFileString(pass);
- if (!strcmp("Password", passres))
- {
- value = GetFileValue(pass);
- strmid(AccountInfo[playerid][Password], value, 0, strlen(value)-1, 128);
- }
- if (!strcmp(AccountInfo[playerid][Password], password, true))
- {
- while (fread(account, pass, 256))
- {
- passres = GetFileString(pass);
- if (strfind(passres, "AdminLevel") != -1)
- {
- value = GetFileValue(pass);
- AccountInfo[playerid][AdminLevel] = strval(value);
- }
- if (strfind(passres, "Cash") != -1)
- {
- value = GetFileValue(pass);
- AccountInfo[playerid][Cash] = strval(value);
- }
- if (strfind(passres, "Warnings") != -1)
- {
- value = GetFileValue(pass);
- AccountInfo[playerid][Warns] = strval(value);
- }
- if (strfind(passres, "WarnReason1") != -1)
- {
- value = GetFileValue(pass);
- strmid(AccountInfo[playerid][WarnReason1], value, 0, strlen(value)-1, 128);
- }
- if (strfind(passres, "WarnReason2") != -1)
- {
- value = GetFileValue(pass);
- strmid(AccountInfo[playerid][WarnReason2], value, 0, strlen(value)-1, 128);
- }
- if (strfind(passres, "WarnReason3") != -1)
- {
- value = GetFileValue(pass);
- strmid(AccountInfo[playerid][WarnReason3], value, 0, strlen(value)-1, 128);
- }
- }
- fclose(account);
- AccountInfo[playerid][Logged] = 1;
- }
- else
- {
- HideButton(PassClickBox, playerid);
- HideButton(PassClickBox_Fail, playerid);
- ShowButton(PassClickBox_Fail, playerid);
- fclose(account);
- return 1;
- }
- GivePlayerMoney(playerid, AccountInfo[playerid][Cash]);
- HideButton(PassClickBox, playerid);
- HideButton(PassClickBox_Fail, playerid);
- ShowButton(PassClickBox_Suc, playerid);
- LogIn(playerid);
- printf("%s is logging in...", name);
- if (AccountInfo[playerid][AdminLevel] > 0)
- {
- format(str, sizeof str, "| You are now logged in as a level %d admin |", AccountInfo[playerid][AdminLevel]);
- SendClientMessage(playerid, LIGHTGREEN, str);
- ViewCmds[playerid] = 0;
- }
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- PassClickBox = CreateButtonEx(277.000000, 255.000000, WHITE, "Enter your password", 375, 0, 0.25, 0.5);
- PassClickBox_Fail = CreateButtonEx(277.000000, 255.000000, RED, "Invalid password", 375, 0, 0.25, 0.5);
- PassClickBox_Suc = CreateButtonEx(277.000000, 255.000000, GREEN, "Correct", 375, 0, 0.25, 0.5);
- PassClickBox_Reg = CreateButtonEx(277.000000, 255.000000, RED, "Please ~r~/register", 375, 0, 0.25, 0.5);
- Login = TextDrawCreate(225.000000,165.000000," Login~n~~n~~n~~n~~n~~n~~n~");
- Nick = TextDrawCreate(230.000000,203.000000,"Nick:");
- PasswordKey = TextDrawCreate(230.000000,234.000000,"Password:");
- TextDrawUseBox(Login,1);
- TextDrawBoxColor(Login,0x00000066);
- TextDrawTextSize(Login,425.000000,39.000000);
- TextDrawAlignment(Login,0);
- TextDrawAlignment(Nick,0);
- TextDrawAlignment(PasswordKey,0);
- TextDrawBackgroundColor(Login,0x000000ff);
- TextDrawBackgroundColor(Nick,0x000000ff);
- TextDrawBackgroundColor(PasswordKey,0x000000ff);
- TextDrawFont(Login,0);
- TextDrawLetterSize(Login,0.799999,1.800000);
- TextDrawFont(Nick,2);
- TextDrawLetterSize(Nick,0.399999,0.899999);
- TextDrawFont(PasswordKey,2);
- TextDrawLetterSize(PasswordKey,0.299999,1.000000);
- TextDrawColor(Login,0xffffffff);
- TextDrawColor(Nick,0xffffffff);
- TextDrawColor(PasswordKey,0xffffffff);
- TextDrawSetOutline(Login,1);
- TextDrawSetOutline(Nick,1);
- TextDrawSetOutline(PasswordKey,1);
- TextDrawSetProportional(Login,1);
- TextDrawSetProportional(Nick,1);
- TextDrawSetProportional(PasswordKey,1);
- TextDrawSetShadow(Login,1);
- TextDrawSetShadow(Nick,1);
- TextDrawSetShadow(PasswordKey,1);
- for(new i, m = GetMaxPlayers(); i < m; i++)
- {
- Name[i] = TextDrawCreate(317.000000,203.000000,"Name");
- Pass[i] = TextDrawCreate(317.000000,234.000000,"???");
- TextDrawUseBox(Name[i],1);
- TextDrawBoxColor(Name[i],0xffffff66);
- TextDrawTextSize(Name[i],419.000000,1.000000);
- TextDrawUseBox(Pass[i],1);
- TextDrawBoxColor(Pass[i],0xffffff66);
- TextDrawTextSize(Pass[i],419.000000,0.000000);
- TextDrawAlignment(Name[i],0);
- TextDrawAlignment(Pass[i],0);
- TextDrawBackgroundColor(Name[i],0x000000ff);
- TextDrawBackgroundColor(Pass[i],0x000000ff);
- TextDrawFont(Name[i],3);
- TextDrawLetterSize(Name[i],0.299999,1.000000);
- TextDrawFont(Pass[i],1);
- TextDrawLetterSize(Pass[i],0.199999,0.899999);
- TextDrawColor(Name[i],YELLOW);
- TextDrawColor(Pass[i],YELLOW);
- TextDrawSetOutline(Name[i],1);
- TextDrawSetOutline(Pass[i],1);
- TextDrawSetProportional(Name[i],1);
- TextDrawSetProportional(Pass[i],1);
- TextDrawSetShadow(Name[i],1);
- TextDrawSetShadow(Pass[i],1);
- MenuShown[i] = false;
- strmid(PassBox[i],"-",0,1);
- }
- CreateCursor();
- print("<|-----------------------------------------|>");
- print(" | .: [ - SeifAdmin Script by Seif - ] :. |");
- print("<|-----------------------------------------|>");
- return 1;
- }
- public OnFilterScriptExit()
- {
- TextDrawDestroy(Login);
- TextDrawDestroy(Nick);
- TextDrawDestroy(PasswordKey);
- for(new i, m = GetMaxPlayers(); i < m; i++)
- {
- TextDrawDestroy(Name[i]);
- TextDrawDestroy(Pass[i]);
- }
- DeleteButtons();
- KillCursor();
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- #if defined LOGIN_BEFORE_SPAWN
- new string[128];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,sendername,24);
- format(string,128,"/sAccounts/%s.seifadmin",sendername);
- if (fexist(string) && AccountInfo[playerid][Logged] == 0)
- {
- SendClientMessage(playerid,RED,"Your account is registered. You must first login in order to spawn.");
- return 0;
- }
- #endif
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Cursor_OnPlayerConnect(playerid);
- AccountInfo[playerid][Jail] = 0;
- AccountInfo[playerid][AdminLevel] = 0;
- AccountInfo[playerid][Warns] = 0;
- AccountInfo[playerid][Logged] = 0;
- AccountInfo[playerid][Mute] = 0;
- format(AccountInfo[playerid][Password], 128, " ");
- format(AccountInfo[playerid][WarnReason1], 128, "NONE");
- format(AccountInfo[playerid][WarnReason2], 128, "NONE");
- format(AccountInfo[playerid][WarnReason3], 128, "NONE");
- Drugs[playerid] = 0;
- Hide[playerid] = 0;
- SuperPunch[playerid] = 0;
- ViewCmds[playerid] = 0;
- PMBlock[playerid] = false;
- new string[128];
- new ip[20];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerIp(playerid, ip, sizeof ip);
- strmid(AccountInfo[playerid][IP], ip, 0, strlen(ip), 128);
- format(string, sizeof(string), "/sAccounts/%s.seifadmin", sendername);
- if (!fexist(string)) return SendClientMessage(playerid,WHITE,"SERVER: Your account isn't registered. Please register ( /register [password] )");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- OnPlayerUpdateAccount(playerid);
- AccountInfo[playerid][Jail] = 0;
- AccountInfo[playerid][AdminLevel] = 0;
- AccountInfo[playerid][Warns] = 0;
- AccountInfo[playerid][Logged] = 0;
- AccountInfo[playerid][Mute] = 0;
- Drugs[playerid] = 0;
- Hide[playerid] = 0;
- SuperPunch[playerid] = 0;
- ViewCmds[playerid] = 0;
- strmid(AccountInfo[playerid][IP], " ", 0, strlen(" "), 20);
- HideLoginMenu(playerid);
- MenuShown[playerid] = false;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if (!AccountInfo[playerid][Logged])
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof name);
- TextDrawSetString(Name[playerid], name);
- TextDrawSetString(Pass[playerid], "l");
- ShowLoginMenu(playerid);
- MenuShown[playerid] = true;
- TogglePlayerControllable(playerid, false);
- new string[128];
- format(string, sizeof(string), "/sAccounts/%s.seifadmin", name);
- if (!fexist(string)) ShowButton(PassClickBox_Reg, playerid);
- else ShowButton(PassClickBox, playerid);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Drugs[playerid] = 0;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if (MenuShown[playerid] == true)
- {
- strmid(PassBox[playerid], text, 0, strlen(text), 128);
- for(new p; p < strlen(text); p++)
- {
- text[p] = '?';
- }
- TextDrawSetString(Pass[playerid], text);
- return 0;
- }
- if (AccountInfo[playerid][Mute] == 1)
- {
- SendClientMessage(playerid, RED, "You are muted! You cannot talk.");
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[128];
- new tmp[128];
- new idx;
- new giveplayername[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- new string[128];
- cmd = strtok(cmdtext,idx);
- for(new i = 0; i < GetMaxPlayers(); i++)
- {
- if (IsPlayerConnected(i))
- {
- if (AccountInfo[i][AdminLevel] > 0 && ViewCmds[i] == 1)
- {
- for(new v = 0; v < sizeof(ViewCommands); v++) if (!strcmp(cmdtext, ViewCommands[v], true))
- {
- GetPlayerName(playerid, sendername, sizeof sendername);
- format(tmp, 128, "[VIEWCMDS] [%d]%s: %s", playerid, sendername, cmdtext);
- SendClientMessage(i, PURPLE, tmp);
- }
- }
- }
- }
- /* [ADMINS] */
- if(strcmp(cmd, "/makeadmin", true) == 0) // Make player an admin
- {
- if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /makeadmin [playerid] [level 1-5]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Player will be an admin depending on the given level.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp, playerid);
- tmp = strtok(cmdtext, idx);
- new level = strval(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (level >= 0)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- printf("ADMIN: %s made %s a level %d admin.", sendername, giveplayername, level);
- format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, sendername);
- SendClientMessage(giveplayerid, LIGHTBLUE, string);
- format(string, sizeof(string), "|- Administrator %s has given %s an Admin Level. [Level: %d] -|", sendername,giveplayername,level);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- AccountInfo[giveplayerid][AdminLevel] = level;
- format(string, sizeof(string), "You have given %s level %d admin.", giveplayername,AccountInfo[giveplayerid][AdminLevel]);
- SendClientMessage(playerid, LIGHTBLUE, string);
- }
- else return SendClientMessage(playerid, RED, "You can't go below level 0!");
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%i is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not a lead admin!");
- return 1;
- }
- if(strcmp(cmd, "/gmx", true) == 0) // Reboot the server
- {
- if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return GameModeExit();
- else return SendClientMessage(playerid, RED, "You are not a lead admin!");
- }
- if(strcmp(cmd, "/kickall", true) == 0) // Kick everyone except the one who does this
- {
- new reason[128];
- if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /kickall [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick all the players.");
- return 1;
- }
- printf("ADMIN: Admin %s kicked everyone. Reason: %s", sendername, reason);
- format(string, sizeof(string), "-| Administrator %s kicked everyone. [Reason: %s ] |-", sendername,reason);
- SendClientMessageToAll(ADMIN_RED, string);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if (i != playerid)
- {
- Kick(i);
- KickLog(string);
- }
- }
- }
- else SendClientMessage(playerid, RED, "You are not a lead admin!");
- return 1;
- }
- if(strcmp(cmd, "/nuke", true) == 0) // Nuke a player (explode)
- {
- if (AccountInfo[playerid][AdminLevel] >= 3)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /nuke [playerid]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Player will explode.");
- return 1;
- }
- new Float:X,Float:Y,Float:Z;
- new giveplayerid = ReturnUser(tmp, playerid);
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerPos(giveplayerid, X,Y,Z);
- CreateExplosion(X,Y,Z,2,3.0);
- SetPlayerHealth(giveplayerid, 0.0);
- format(string, sizeof(string), "-| Administrator %s nuked %s |-",sendername,giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string,1);
- }
- else if (!IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/setscore", true) == 0) // Set player a score
- {
- if (IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /setscore [playerid] [score]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will set a specified player's score");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /score [playerid] [score]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will set a specified player's score");
- return 1;
- }
- new score = strval(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerScore(giveplayerid);
- SetPlayerScore(giveplayerid, score);
- format(string, sizeof(string), "You have changed %s's score number to %d.",giveplayername, score);
- SendClientMessage(playerid, GREEN, string);
- }
- else if (!IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/angle", true) == 0) // Shows your current angle + sets it
- {
- if (IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
- {
- new Float:angle;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /angle [angle degree]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will change your current angle.");
- GetPlayerFacingAngle(playerid,angle);
- format(string, sizeof(string), "HELP: Your current angle is %f", angle);
- SendClientMessage(playerid, ORANGE, string);
- return 1;
- }
- angle = floatstr(tmp);
- if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- SetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
- format(string, sizeof(string), "You have changed your angle degree to %f" ,angle);
- SendClientMessage(playerid, GREEN, string);
- }
- else
- {
- SetPlayerFacingAngle(playerid,angle);
- format(string, sizeof(string), "You have changed your angle degree to %f",angle);
- SendClientMessage(playerid, GREEN, string);
- }
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/rangeban", true) == 0) // Range-bans a player with the amount of ranges entered.
- {
- if (AccountInfo[playerid][AdminLevel] >= 4)
- {
- tmp = strtok(cmdtext,idx);
- if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /rangeban [playername/id] [ranges(2 max)]");
- new ip[20],ban[128];
- new giveplayerid = ReturnUser(tmp);
- if (IsPlayerConnected(giveplayerid))
- {
- tmp = strtok(cmdtext,idx);
- if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /rangeban [playername/id] [RANGES(2 max)]");
- new ranges = strval(tmp);
- if (ranges < 0 || ranges > 2) return SendClientMessage(playerid, RED, "Minimum ranges: 0 | Maximum ranges: 2");
- if (ranges == 0)
- {
- Ban(giveplayerid);
- }
- GetPlayerName(giveplayerid, giveplayername, sizeof giveplayername);
- GetPlayerIp(giveplayerid, ip, sizeof ip);
- new count = 1;
- for(new i = strlen(ip); i > 0; i--)
- {
- if (ip[i] == '.')
- {
- if (count == ranges)
- {
- format(ban, sizeof ban, "banip %s", ip);
- SendRconCommand(ban);
- break;
- }
- else count++;
- }
- else ip[i] = '*';
- }
- format(ban, sizeof ban, "%s has been banned with the ip '%s'", giveplayername, ip);
- SendClientMessage(playerid, GREEN, ban);
- }
- else
- {
- format(string, sizeof(string), "%i is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You're not a lead admin !");
- return 1;
- }
- if(strcmp(cmd, "/ip", true) == 0) // Look at the player's IP address
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /ip [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: View a player's IP.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- new sstring[256];
- new ip[20];
- GetPlayerIp(giveplayerid, ip, sizeof ip);
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(sstring, sizeof(sstring), "-| %s's IP: %s |-", giveplayername,ip);
- SendClientMessage(playerid,LIGHTBLUE, sstring);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin.");
- return 1;
- }
- if(strcmp(cmd, "/ban", true) == 0) // Bans a player from the server
- {
- new reason[128];
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /ban [playername/id] [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will BAN the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if (AccountInfo[giveplayerid][AdminLevel] > AccountInfo[playerid][AdminLevel])
- {
- format(string, sizeof(string), "-| [%i]%s tried to ban you! |-",playerid,sendername);
- SendClientMessage(giveplayerid, ADMIN_RED,string);
- SendClientMessage(playerid, ADMIN_RED, "You are not allowed to ban an admin with a higher level than you!");
- }
- else if (giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /ban [playername/id] [reason]");
- new ip[20];
- printf("ADMIN: Admin %s banned %s. Reason: %s", sendername, giveplayername, reason);
- format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: %s ] |-", sendername, giveplayername, reason);
- SendClientMessageToAll(ADMIN_RED, string);
- GetPlayerIp(giveplayerid, ip, sizeof ip);
- format(string, sizeof(string), "-| Banned Player's IP: %s |-", ip);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- AccountInfo[giveplayerid][AdminLevel] = 0; // Resets the banned player's admin level for security reasons
- format(reason, sizeof reason, "[%s]%s", sendername, reason);
- BanEx(giveplayerid, reason);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/kick", true) == 0) // Kicks the player from the server
- {
- new reason[128];
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
- printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason);
- format(string, sizeof(string), "-| Administrator %s kicked %s. [Reason: %s ] |-", sendername, giveplayername, reason);
- SendClientMessageToAll(ADMIN_RED, string);
- Kick(giveplayerid);
- KickLog(string);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/mute", true) == 0) // Mutes the player from talking in the chat box
- {
- new reason[128];
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /mute [playername/id] [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will mute the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (AccountInfo[giveplayerid][Mute] == 0)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /mute [playername/id] [reason]");
- printf("ADMIN: Admin %s muted %s. Reason: %s", sendername, giveplayername, reason);
- format(string, sizeof(string), "-| Administrator %s muted %s. [Reason: %s ]|-", sendername,giveplayername,reason);
- SendClientMessageToAll(ADMIN_RED, string);
- AccountInfo[giveplayerid][Mute] = 1;
- }
- else if (AccountInfo[giveplayerid][Mute] == 1) SendClientMessage(playerid, RED, "Player is already muted!");
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/unmute", true) == 0) // Unmutes a muted player
- {
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /unmute [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will unmute the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (AccountInfo[giveplayerid][Mute] == 1)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "-| Administrator %s unmuted %s |-", sendername,giveplayername);
- SendClientMessageToAll(ADMIN_RED, string);
- AccountInfo[giveplayerid][Mute] = 0;
- }
- else if (AccountInfo[giveplayerid][Mute] == 0) SendClientMessage(playerid, RED, "Player isn't muted.");
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/drugs", true) == 0) // Will make the player invinsible until death
- {
- if (AccountInfo[playerid][AdminLevel] > 1 || IsPlayerAdmin(playerid))
- {
- SetPlayerHealth(playerid,999999999); // max HP
- Drugs[playerid] = 1;
- SendClientMessage(playerid, GREEN, "You are now high on drugs...");
- }
- else SendClientMessage(playerid, RED, "Drugs are bad for you!");
- return 1;
- }
- if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
- {
- new reason[128];
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /freeze [playername/id] [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will freeze the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /freeze [playername/id] [reason]");
- format(string, sizeof(string), "-| Administrator %s froze %s. [Reason: %s ] |-", sendername, giveplayername, reason);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- TogglePlayerControllable(giveplayerid, false);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/unfreeze", true) == 0) // Unfreezes the player
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /unfreeze [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will unfreeze the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "-| Administrator %s unfroze %s |-", sendername,giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- TogglePlayerControllable(giveplayerid, true);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/setname", true) == 0) // Changes a player's name
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /setname [playername/id] [newname]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will change the player's current name. ");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /setname [playername/id] [newname]");
- format(string, sizeof(string), "-| Administrator %s renamed %s. [New Name: %s ] |-", sendername, giveplayername, tmp);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- SetPlayerName(giveplayerid, tmp);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/givecash", true) == 0) // Gives some cash to the player
- {
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /givecash [playername/id] [cash]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will give the player some cash. ");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- new cash = strval(tmp);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /givecash [playername/id] [cash]");
- format(string, sizeof(string), "-| Administrator %s gave %s $%d |-", sendername,giveplayername,cash);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- GivePlayerMoney(giveplayerid, cash);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/kill", true) == 0) // If an admin, it kills the player you want. If not, suicide.
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /kill [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will kill the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "-| Administrator %s killed %s |-", sendername,giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- SetPlayerHealth(giveplayerid, 0.0);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, RED, "You have committed suicide.");
- SetPlayerHealth(playerid,0.0);
- }
- return 1;
- }
- if(strcmp(cmd, "/goto", true) == 0) // Teleports to a player
- {
- new Float:pX,Float:pY,Float:pZ;
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /goto [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport to the specified player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2);
- }
- else
- {
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetPlayerPos(playerid,pX,pY,pZ+2);
- }
- SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/get", true) == 0) // Teleports the player to your position
- {
- new Float:pX,Float:pY,Float:pZ;
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /get [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport the specified player to you.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
- {
- GetPlayerPos(playerid,pX,pY,pZ);
- SetVehiclePos(GetPlayerVehicleID(giveplayerid),pX,pY,pZ+2);
- }
- else
- {
- GetPlayerPos(playerid,pX,pY,pZ);
- SetPlayerPos(giveplayerid,pX,pY,pZ+2);
- }
- SetPlayerInterior(giveplayerid,GetPlayerInterior(playerid));
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/teleport", true) == 0) // Teleports the player to the other player
- {
- if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /teleport [playername/id] [targetname/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport the player to the target.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /teleport [playername/id] [targetname/id]");
- new targetid = ReturnUser(tmp, playerid);
- if (targetid == INVALID_PLAYER_ID) return 1;
- new Float:tX,Float:tY,Float:tZ;
- if (GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
- {
- GetPlayerPos(targetid,tX,tY,tZ);
- SetVehiclePos(GetPlayerVehicleID(giveplayerid),tX,tY,tZ+2);
- }
- else
- {
- GetPlayerPos(targetid,tX,tY,tZ);
- SetPlayerPos(giveplayerid,tX,tY,tZ+2);
- }
- SetPlayerInterior(giveplayerid,GetPlayerInterior(targetid));
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(!strcmp(cmdtext, "//", true, 2)) // Admin chat
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- if(!strlen(cmdtext[2])) return SendClientMessage(playerid, ORANGE, "USAGE: //<text>"), SendClientMessage(playerid, ORANGE, "HELP: Example: //Hi");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin [%i]%s: %s" ,playerid,sendername, cmdtext[2]);
- SendClientMessageToAdmins(DARKPINK, string, 1);
- return 1;
- }
- else return SendClientMessage(playerid, RED, "You are not an admin!");
- }
- if(strcmp(cmd, "/slap", true) == 0) // Slap a player
- {
- new Float:pX,Float:pY,Float:pZ;
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /slap [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will slap the specified player");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetPlayerPos(giveplayerid,pX,pY,pZ+5);
- format(string, sizeof(string), "-| Administrator %s slapped %s |-",sendername, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/bslap", true) == 0) // Slap a player 2 times higher than /slap
- {
- new Float:pX,Float:pY,Float:pZ;
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /bslap [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will double slap the specified player");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetPlayerPos(giveplayerid,pX,pY,pZ+10);
- format(string, sizeof(string), "-| Administrator %s bitch slapped %s |-",sendername, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/disarm", true) == 0) // Reset the player's weapons
- {
- if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /disarm [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will disarm the player.");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- ResetPlayerWeapons(giveplayerid);
- format(string, sizeof(string), "-| Administrator %s disarmed %s |-",sendername, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
- {
- if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new result[128];
- result = bigstrtok(cmdtext, idx);
- if(!strlen(result))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /say [message]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an admin message.");
- return 1;
- }
- format(string, sizeof(string), "* Admin: %s", result);
- SendClientMessageToAll(LIGHTRED, string);
- printf("%s", string);
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/bc", true) == 0 || strcmp(cmd, "/broadcast", true) == 0) // Displays a screen message
- {
- if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new result[128];
- result = bigstrtok(cmdtext, idx);
- if(!strlen(result))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /bc [message] [time in seconds(if non entered, 5 seconds will be the time by default)]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast a screen message");
- return 1;
- }
- new time;
- tmp = strtok(cmdtext, idx);
- if (!strlen(tmp)) time = 5;
- else time = strval(tmp);
- format(string, sizeof(string), "~w~%s", result);
- GameTextForAll(string, time*1000, 4);
- printf("%s", string);
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/veh", true) == 0) // Spawn a vehicle. Name supported too.
- {
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /veh [modelname/id] [color1] [color2]");
- return 1;
- }
- new car = GetVehicleModelIDFromName(tmp);
- if (car == -1)
- {
- car = strval(tmp);
- if(car < 400 || car > 611) return SendClientMessage(playerid, RED, "Vehicle ID can't be below 400 nor above 611 !");
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /veh [modelname/id] [color1] [color2]");
- return 1;
- }
- new color1 = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /veh [modelname/id] [color1] [color2]");
- return 1;
- }
- new color2 = strval(tmp);
- new Float:X,Float:Y,Float:Z,Float:A;
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerFacingAngle(playerid, A);
- X += (5 * floatsin(-A, degrees));
- Y += (5 * floatcos(-A, degrees));
- new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 600000000);
- format(string, sizeof(string), "Vehicle %s(%d) spawned.", VehNames[GetVehicleModel(carid)-400], carid);
- SendClientMessage(playerid, GREEN, string);
- GetPlayerName(playerid,sendername,sizeof(sendername));
- format(string, sizeof(string), "-| Administrator %s spawned a vehicle(%d) [ Model: %s ] |-", sendername, carid, VehNames[GetVehicleModel(carid)-400]);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/pweapons", true) == 0) // Checks a player's weapons
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /pweapons [playerid/name]");
- return 1;
- }
- new giveplayerid = ReturnUser(tmp);
- if (giveplayerid != INVALID_PLAYER_ID)
- {
- new bullets[12];
- new weapons[12];
- new weapname[12][20];
- for(new i = 0; i < 12; i++)
- {
- GetPlayerWeaponData(giveplayerid, i+1, weapons[i], bullets[i]);
- GetWeaponName(weapons[i], weapname[i], 20);
- }
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- format(string,sizeof(string)," |- %s's Weapons -|",giveplayername);
- SendClientMessage(playerid,LIGHTGREEN,string);
- format(string, sizeof(string),"%s(0) - %s(%d) - %s(%d) - %s(%d) - %s(%d) - %s(%d)",weapname[0],weapname[1],bullets[1],weapname[2],bullets[2],weapname[3],bullets[3],weapname[4],bullets[4],weapname[5],bullets[5]);
- SendClientMessage(playerid,YELLOW,string);
- format(string,sizeof(string),"%s(%d) - %s(%d) - %s(%d) - %s(0) - %s(0) - %s(0)",weapname[6],bullets[6],weapname[7],bullets[7],weapname[8],bullets[8],weapname[9],weapname[10],weapname[11]);
- SendClientMessage(playerid,YELLOW,string);
- }
- else SendClientMessage(playerid, RED, "Player is not active.");
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/sethp", true) == 0) // Sets a player's health
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 3)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /sethp [playerid/name] [health]");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- new Float:hp = floatstr(tmp);
- if (targetid != INVALID_PLAYER_ID)
- {
- if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /sethp [playerid/name] [health]");
- SetPlayerHealth(targetid,hp);
- if (hp < 1) Drugs[targetid] = 0;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- format(string,sizeof(string),"|- Administrator %s has changed %s's HP. [HP: %.2f] -|",sendername,giveplayername,hp);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else SendClientMessage(playerid, RED, "Player is not active.");
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if (strcmp(cmd, "/logout", true) == 0) // Logs off the admin
- {
- if(AccountInfo[playerid][Logged] == 1)
- {
- if(AccountInfo[playerid][AdminLevel] >= 1)
- {
- OnPlayerUpdateAccount(playerid);
- AccountInfo[playerid][Logged] = 0;
- AccountInfo[playerid][AdminLevel] = 0;
- SendClientMessage(playerid, GREEN, "You have successfuly logged out.");
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- }
- else return SendClientMessage(playerid, RED, "You're not logged in! ( /login [password] )");
- return 1;
- }
- if(strcmp(cmd, "/warn", true) == 0) // Warns a player. 3 warnings = auto-ban
- {
- if (AccountInfo[playerid][AdminLevel] >= 3)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /warn [playername/id] [reason]");
- new targetid = ReturnUser(tmp);
- if(IsPlayerConnected(targetid))
- {
- if(targetid != INVALID_PLAYER_ID)
- {
- new reason[128];
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /warn [playername/id] [reason]");
- new sstring[128];
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- AccountInfo[targetid][Warns] += 1;
- format(string, sizeof(string), "You got warned by Admin %s. Reason: %s", sendername, reason);
- SendClientMessage(targetid, ADMIN_RED, string);
- format(string, sizeof(string), "-| Administrator %s warned %s. [Reason: %s ] |-", sendername,giveplayername, reason);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- format(string, sizeof(string), "-| %s's warnings: %d |-",giveplayername, AccountInfo[targetid][Warns]);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- if (AccountInfo[targetid][Warns] == 1) strmid(AccountInfo[targetid][WarnReason1], reason, 0, strlen(reason), 128);
- else if (AccountInfo[targetid][Warns] == 2) strmid(AccountInfo[targetid][WarnReason2], reason, 0, strlen(reason), 128);
- else if (AccountInfo[targetid][Warns] == 3) strmid(AccountInfo[targetid][WarnReason3], reason, 0, strlen(reason), 128);
- SendClientMessage(targetid, RED, "3 Warnings = Auto-Ban!");
- if(AccountInfo[targetid][Warns] >= 3)
- {
- new ip[128];
- format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: 3 Warnings...] |-", sendername,giveplayername);
- BanLog(string);
- SendClientMessageToAll(ADMIN_RED, string);
- for(new i = 0; i < 3; i++)
- {
- if (i == 0) format(string, sizeof (string), "-| Reason #%d: %s |-", i+1, AccountInfo[targetid][WarnReason1]);
- else if (i == 1) format(string, sizeof (string), "-| Reason #%d: %s |-", i+1, AccountInfo[targetid][WarnReason2]);
- else if (i == 2) format(string, sizeof (string), "-| Reason #%d: %s |-", i+1, AccountInfo[targetid][WarnReason3]);
- SendClientMessageToAll(ADMIN_RED, string);
- }
- GetPlayerIp(targetid,ip,128);
- format(sstring, sizeof(sstring), "-| Banned Player's IP: %s |-", ip);
- SendClientMessageToAdmins(ADMIN_RED, sstring,1);
- AccountInfo[targetid][AdminLevel]= 0;
- AccountInfo[targetid][Warns] = 0;
- format(AccountInfo[targetid][WarnReason1], 128, "NONE");
- format(AccountInfo[targetid][WarnReason2], 128, "NONE");
- format(AccountInfo[targetid][WarnReason3], 128, "NONE");
- Ban(giveplayerid);
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/pstats", true) == 0) // Views the player's stats
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /pstats [playername/id]");
- new targetid = ReturnUser(tmp);
- if (targetid != INVALID_PLAYER_ID)
- {
- new Float:health,Float:armor;
- GetPlayerHealth(targetid,health);
- GetPlayerArmour(targetid,armor);
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- format(string, sizeof(string), "Stats of %s: Health: '%.2f' - Cash: '$%d' - Warnings: '%d' - Armor: '%.2f'",giveplayername, health,GetPlayerMoney(targetid),AccountInfo[targetid][Warns],armor);
- SendClientMessage(playerid,PURPLE,string);
- if(AccountInfo[giveplayerid][Logged] == 1) SendClientMessage(playerid, PURPLE, "Logged In: Yes");
- else if(AccountInfo[giveplayerid][Logged] == 0) SendClientMessage(playerid, PURPLE, "Logged In: No");
- SendClientMessage(playerid,YELLOW,"Type /pweapons [playername/id] to check the player's weapons");
- }
- else SendClientMessage(playerid, RED, "Player is not active.");
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/fuck", true) == 0) // Sends a player in the air and explodes
- {
- new Float:pX,Float:pY,Float:pZ;
- new Float:X,Float:Y,Float:Z;
- if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /fuck [playerid]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will fuck up a player.");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerPos(targetid,pX,pY,pZ);
- CreateExplosion(X,Y,Z+50,2,5.0);
- SetPlayerPos(targetid,pX,pY,pZ+50);
- format(string, sizeof(string), "-| Administrator %s fucked %s up |-",sendername, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- SendClientMessage(targetid, RED, "You've been fucked up by an admin.");
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/giveweapon", true) == 0) // Gives a weapon to a player
- {
- if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /giveweapon [playername/id] [weaponid] [ammo]");
- return 1;
- }
- new gun;
- new ammo;
- new targetid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- gun = strval(tmp);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /giveweapon [playername/id] [weaponid] [ammo]");
- tmp = strtok(cmdtext, idx);
- ammo = strval(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- new weap[50];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GivePlayerWeapon(targetid, gun, ammo);
- GetWeaponName(gun, weap, sizeof weap);
- format(string, sizeof(string), "-| Administrator %s gave a weapon(%s) to %s |-",sendername, weap, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- }
- else if(targetid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level!");
- return 1;
- }
- if(strcmp(cmd, "/crash", true) == 0) // Crashes a player's client
- {
- if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /crash [playername/id]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will crash a player.");
- return 1;
- }
- new Float:X,Float:Y,Float:Z;
- new targetid = ReturnUser(tmp);
- if(IsPlayerConnected(targetid))
- {
- GetPlayerPos(giveplayerid,X,Y,Z);
- new objectcrash = CreatePlayerObject(targetid,666666,X,Y,Z,0,0,0); // double-devil has spoken
- SendClientMessage(playerid,GREEN, "Player successfuly crashed.");
- DestroyPlayerObject(targetid, objectcrash);
- }
- else if (!IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You're not a lead admin.");
- return 1;
- }
- if(strcmp(cmd, "/setwarn", true) == 0) // Sets the player's warnings
- {
- if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /setwarn [playername/id] [warning]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will set a certain player's warning.");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- new warnings = strval(tmp);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /setwarn [playername/id] [warning]");
- AccountInfo[targetid][Warns] = warnings;
- format(string, sizeof(string), "Admin %s changed your warnings to %d", sendername, warnings);
- SendClientMessage(targetid, GREEN, string);
- SendClientMessage(targetid, RED, "3 Warnings = Auto-Ban! Ask an admin to check how many warnings you have");
- format(string, sizeof(string), "-| Administrator %s changed %s's warnings. [Warnings: %d ] |-",sendername,giveplayername, AccountInfo[giveplayerid][Warns]);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/an", true) == 0 || strcmp(cmd, "/announce", true) == 0) // Broadcasts an 'announcement' message.
- {
- if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new result[128];
- result = bigstrtok(cmdtext, idx);
- if(!strlen(result))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /(an)nounce [message]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an announcement.");
- return 1;
- }
- format(string, sizeof(string), "%s", result);
- SendClientMessageToAll(AQUAGREEN, string);
- printf("Announcement by %s: %s", sendername, string);
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/superpunch", true) == 0) // Triggers an explosion when you use the punch key
- {
- if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext,idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /superpunch [on/off]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will give you the power of Super Punch. When pressing 'PUNCH' button, you will explode but will live.");
- }
- else if(strcmp(tmp,"on",true) == 0)
- {
- SuperPunch[playerid] = 1;
- SendClientMessage(playerid,GREEN,"You are now blessed with SUPER PUNCH! Go knock someone out.");
- }
- else if(strcmp(tmp,"off",true) == 0)
- {
- SuperPunch[playerid] = 0;
- SendClientMessage(playerid,GREEN,"Your super punch is now disabled.");
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if (strcmp(cmd, "/superpunchp", true) == 0) // Gives the Super Punch ability to a player
- {
- new tmp2[128];
- if (AccountInfo[playerid][AdminLevel] > 4 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext,idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,ORANGE,"USAGE: /superpunchp [playername/id] [on/off]");
- SendClientMessage(playerid,ORANGE,"FUNCTION: Will give the player the power of SuperPunch.");
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- tmp2 = strtok(cmdtext,idx);
- if(strcmp(tmp2,"on",true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- SuperPunch[targetid] = 1;
- format(string, sizeof(string), "Admin %s blessed you with the power of Super Punch !", sendername);
- SendClientMessage(targetid,GREEN,string);
- format(string, sizeof(string), "-| Administrator %s blessed %s with the power of Super Punch |-", sendername,giveplayername);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- }
- else if(strcmp(tmp2,"off",true) == 0)
- {
- format(string, sizeof(string), "Admin %s removed your Super Punch power.", sendername);
- SendClientMessage(targetid,RED,string);
- SuperPunch[targetid] = 0;
- }
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid,RED,string);
- }
- }
- else SendClientMessage(playerid,RED,"You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/viewcmds", true) == 0) // Views unknown commands and commands mentioned in 'ViewCommands' variable entered by players
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext,idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /viewcmds [on/off]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will see the players typing some commands and wrong commands.");
- }
- else if(strcmp(tmp,"on",true) == 0)
- {
- ViewCmds[playerid] = 1;
- SendClientMessage(playerid,GREEN,"You can know view players typing some commands and wrong commands.");
- }
- else if(strcmp(tmp,"off",true) == 0)
- {
- ViewCmds[playerid] = 0;
- SendClientMessage(playerid,GREEN,"You can no longer view players typing some commands and wrong commands.");
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/jail", true) == 0) // Jails a player
- {
- if (AccountInfo[playerid][AdminLevel] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /jail [playername/id] [reason]");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(IsPlayerConnected(targetid))
- {
- if(targetid != INVALID_PLAYER_ID)
- {
- if(AccountInfo[giveplayerid][Jail] == 0)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new reason[128];
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /jail [playername/id] [reason]");
- format(string, sizeof(string), "You got jailed by Admin %s. Reason: %s", sendername, reason);
- SendClientMessage(targetid, ADMIN_RED, string);
- format(string, sizeof(string), "-| Administrator %s jailed %s. [ Reason: %s ] |-",sendername,giveplayername, reason);
- SendClientMessageToAll(ADMIN_RED,string);
- AccountInfo[targetid][Jail] = 1;
- OnPlayerJailed(targetid);
- return 1;
- }
- else SendClientMessage(playerid, RED, "Player is already jailed!");
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/unjail", true) == 0) // Unjails a player
- {
- if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /unjail [playername/id]");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- if(AccountInfo[giveplayerid][Jail] == 1)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "-| Administrator %s unjailed %s |-",sendername, giveplayername);
- SendClientMessageToAll(ADMIN_RED,string);
- AccountInfo[targetid][Jail] = 0;
- OnPlayerUnjailed(targetid);
- }
- else SendClientMessage(playerid, RED, "Player is not jailed!");
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/gotoveh", true) == 0) // Teleports to a vehicle's position
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /gotoveh [vehicleid]");
- return 1;
- }
- new car = strval(tmp);
- if (AccountInfo[playerid][AdminLevel] >= 3)
- {
- new Float:vx,Float:vy,Float:vz;
- GetVehiclePos(car,vx,vy,vz);
- if (GetPlayerState(playerid) == 2)
- SetVehiclePos(GetPlayerVehicleID(playerid),vx,vy+2,vz);
- else
- SetPlayerPos(playerid,vx,vy,vz+1);
- SetPlayerInterior(playerid,0);
- format(string,256,"You have teleported to vehicle id %d(%s)",car, VehNames[GetVehicleModel(car)-400]);
- SendClientMessage(playerid,GREEN,string);
- }
- else SendClientMessage(playerid,RED,"You're not an admin with the required level");
- return 1;
- }
- if(!strcmp(cmdtext, "/aclearchat", true)) // Clears the chatbox for everyone
- {
- if(AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
- {
- for(new chat = 0; chat <= 50; chat++) SendClientMessageToAll(GREEN, " ");
- GetPlayerName(playerid, sendername, 20);
- format(string, 256, "-| Administrator %s cleared the chat |-", sendername);
- SendClientMessageToAll(ADMIN_RED, string);
- return 1;
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/hide", true) == 0) // Hides you from the admin list
- {
- if (AccountInfo[playerid][AdminLevel] >= 4)
- {
- Hide[playerid] = 1;
- SendClientMessage(playerid,GREEN,"|- You're now hidden from the admin list -|");
- }
- return 1;
- }
- if(strcmp(cmd, "/unhide", true) == 0)
- {
- if (AccountInfo[playerid][AdminLevel] >= 4) // Unhides you from the admin list
- {
- if (Hide[playerid] != 1) return SendClientMessage(playerid,RED,"You're not hidden in the admin list!");
- Hide[playerid] = 0;
- SendClientMessage(playerid,GREEN,"|- You're now visible in the admin list -|");
- }
- return 1;
- }
- if(strcmp(cmd, "/virtual", true) == 0) // Sets the player's virtual world
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /virtual [playerid/name] [virtual world (0-255)]");
- new targetid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- new v = strval(tmp);
- if (targetid != INVALID_PLAYER_ID)
- {
- if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /virtual [playerid/name] [virtual world (0-255)]");
- SetPlayerVirtualWorld(targetid,v);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- format(string,sizeof(string),"|- Administrator %s has changed %s's Virtual World. [World: %d] -|",sendername,giveplayername,v);
- SendClientMessageToAdmins(ADMIN_RED,string,1);
- }
- else SendClientMessage(playerid, RED, "Player is not active.");
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd,"/count", true) == 0) // Starts a count down
- {
- tmp = strtok(cmdtext, idx);
- new count = strval(tmp);
- if (!strlen(tmp)) count = 5;
- if (AccountInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid,RED,"You're not an admin");
- if (Count > 0) return SendClientMessage(playerid, RED, "Countdown is already in progress.");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string,sizeof(string),"|- Administrator %s started a countdown from %d -|", sendername, count);
- SendClientMessageToAll(LIGHTGREEN, string);
- Count = count;
- CountDown();
- return 1;
- }
- if(strcmp(cmd, "/view", true) == 0) // Spectates a player
- {
- if (AccountInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid,RED,"You're not an admin !");
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "|__________________________________|");
- SendClientMessage(playerid, ORANGE, "USAGE: /view [playerid]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will spectate a player.");
- SendClientMessage(playerid, ORANGE, "HELP: /view off to stop spectating");
- SendClientMessage(playerid, ORANGE, "|__________________________________|");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if (giveplayerid != INVALID_PLAYER_ID)
- {
- if (AccountInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid,RED,"You're not an admin !");
- TogglePlayerSpectating(playerid, 1);
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
- SetPlayerInterior(playerid,GetPlayerInterior(targetid));
- if (IsPlayerInAnyVehicle(targetid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
- else PlayerSpectatePlayer(playerid, targetid);
- SendClientMessage(playerid, ORANGE, "HELP: '/view off' to stop spectating");
- }
- else if(strcmp(tmp, "off", true) == 0)
- {
- TogglePlayerSpectating(playerid, 0);
- SetPlayerVirtualWorld(playerid,0);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/blockpm", true) == 0) // Blocks PMs
- {
- if (AccountInfo[playerid][AdminLevel] >= 5)
- {
- if (PMBlock[playerid] == true)
- {
- PMBlock[playerid] = false;
- SendClientMessage(playerid, GREEN, "|- Private messages BLOCKED -|");
- return 1;
- }
- if (PMBlock[playerid] == false)
- {
- PMBlock[playerid] = true;
- SendClientMessage(playerid, GREEN, "|- Private messages UNBLOCKED -|");
- return 1;
- }
- }
- else return SendClientMessage(playerid, RED, "You're not a lead admin!");
- }
- if(!strcmp(cmd, "/seifocalypse", true)) // Launches explosion(s) in front of the player(it follow the previous explosion so it goes straight) as many times has he wants
- {
- if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /seifocalypse [explosions]");
- new Float:X,Float:Y,Float:Z,Float:A;
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerFacingAngle(playerid, A);
- Nuke[playerid] = 1;
- SetTimerEx("NukeBlast", 200, 0, "ddffff",playerid, strval(tmp), X, Y, Z, A);
- }
- else return SendClientMessage(playerid, RED, "You're not a lead admin!");
- return 1;
- }
- if(!strcmp(cmd, "/missile", true)) // Spawns a missile 50 Z higher than player's and drops it to the ground, toggling a huge explosion
- {
- if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
- {
- if (IsValidObject(Missile[playerid])) return SendClientMessage(playerid, RED, "You already dropped a missile that's currently in progress of exploding");
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- Missile[playerid] = CreateObject(3786, X, Y, Z+50, 357.6293, 272.3375, 6.8755);
- MoveObject(Missile[playerid], X, Y, Z, 20.0);
- }
- else return SendClientMessage(playerid, RED, "You're not a lead admin!");
- return 1;
- }
- if (!strcmp(cmd, "/push", true)) // Pushes a player back. Player gets pushed back in motions
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 3)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /push [playername/id]");
- new targetid = ReturnUser(tmp);
- if (targetid != INVALID_PLAYER_ID)
- {
- PushPlayer(targetid, 20, true);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- format(string,sizeof(string),"|- Administrator %s has pushed %s -|", sendername, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else SendClientMessage(playerid, RED, "Player is not active.");
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if (!strcmp(cmd, "/setgravity", true)) // Changes gravity
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 4)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /pussetgravity [gravity float]");
- new Float:gravity = floatstr(tmp);
- SetGravity(gravity);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string,sizeof(string),"|- Administrator %s has changed gravity [ Gravity: %.4f ] -|", sendername, gravity);
- SendClientMessageToAll(ADMIN_RED, string);
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if (!strcmp(cmd, "/settime", true)) // Changes time
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 3)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /settime [time(0-23)]");
- new time = strval(tmp);
- if (time < 0 || time > 23) return SendClientMessage(playerid, RED, "Time can only be from 0 to 23!");
- SetWorldTime(time);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string,sizeof(string),"|- Administrator %s has changed time [ Hour: %d ] -|", sendername, time);
- SendClientMessageToAll(ADMIN_RED, string);
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if (!strcmp(cmd, "/setweather", true)) // Changes time
- {
- if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 4)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /setweather [weather id]");
- new weather = strval(tmp);
- SetWeather(weather);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string,sizeof(string),"|- Administrator %s has changed weather [ Weather: %d ] -|", sendername, weather);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/report", true) == 0) // Available for everyone: reports a player to the admins
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /report [playername/id] [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will report the specified player to the administrators(online).");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new reason[128];
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /report [playerid] [reason]");
- format(string, sizeof(string), "|- %s reported %s [ Reason: %s ]", sendername,giveplayername,reason);
- SendClientMessageToAdmins(ADMIN_RED, string,1);
- format(string, sizeof(string), "Your report on '%s' has been sent to the current online admins. Thank you.", giveplayername);
- SendClientMessage(playerid, GREEN, string);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/ah", true) == 0 || strcmp(cmd, "/ahelp", true) == 0 || strcmp(cmd, "/acommands", true) == 0) // List of admin commands
- {
- if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, YELLOW, " |- Server Admin Commands -|");
- SendClientMessage(playerid, ORANGE, "LEAD(5): /gmx /makeadmin /kickall /crash /blockpm /seifocalypse /missile");
- SendClientMessage(playerid, ORANGE, "LEVEL 1+: /(un)freeze /setscore /angle /kick /setname /kill /goto /ip /pweapons /view /changepassword");
- SendClientMessage(playerid, ORANGE, "LEVEL 2+: /(un)mute /givecash /get /pstats /warn /viewcmds /logout /demolish /virtual");
- SendClientMessage(playerid, ORANGE, "LEVEL 3+: /nuke /ban /disarm /say /giveweapon /slap /gotoveh /(un)jail /sethp /push /settime");
- SendClientMessage(playerid, ORANGE, "LEVEL 4+: /fuck /bc /setwarn /announce /aclearchat /bslap /(un)hide /rangeban /teleport /setgravity /setweather");
- SendClientMessage(playerid, ORANGE, "ADMIN CHAT: // Example: //hello");
- }
- else SendClientMessage(playerid, RED, "You are not an admin!");
- return 1;
- }
- if (strcmp(cmd, "/admins", true) == 0) // Admin list if they're online
- {
- new count = 0;
- SendClientMessage(playerid, GREEN, " [Online Admins]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- if(AccountInfo[i][AdminLevel] >= 1 && AccountInfo[i][AdminLevel] <= 5 && Hide[i] == 0)
- {
- GetPlayerName(i, sendername, sizeof(sendername));
- format(string, 128, "Level %d [%i]%s", AccountInfo[i][AdminLevel],i,sendername);
- SendClientMessage(playerid, LIGHTGREEN, string);
- count++;
- }
- }
- }
- if (count == 0) SendClientMessage(playerid,RED,"No admin online in the list");
- SendClientMessage(playerid, GREEN, "[____________________________________]");
- return 1;
- }
- if (strcmp(cmd, "/register", true) == 0) // Registers an account
- {
- if(IsPlayerConnected(playerid))
- {
- if(AccountInfo[playerid][Logged] == 1)
- {
- SendClientMessage(playerid, RED, "You are already logged in.");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "/sAccounts/%s.seifadmin", sendername);
- new File: hFile = fopen(string, io_read);
- if (hFile)
- {
- SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
- fclose(hFile);
- return 1;
- }
- new tmppass[128];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /register [password]");
- strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
- OnPlayerRegister(playerid, MD5_Hash(tmppass));
- }
- return 1;
- }
- /*if (strcmp(cmd, "/login", true) == 0) // Logins
- {
- new tmppass[128];
- if(AccountInfo[playerid][Logged] == 1) return SendClientMessage(playerid, RED, "You are already logged in.");
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /login [password]");
- new plname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plname, sizeof(plname));
- format(string, sizeof(string), "/sAccounts/%s.seifadmin", plname);
- if(!fexist(string)) return SendClientMessage(playerid, RED, "That account isn't registered! Please register: /register [password]");
- strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
- OnPlayerLogin(playerid, MD5_Hash(tmppass));
- return 1;
- }*/
- if (!strcmp(cmd, "/changepassword", true)) // Changes your password
- {
- if (!AccountInfo[playerid][Logged]) return SendClientMessage(playerid, RED, "You're not logged in.");
- if (AccountInfo[playerid][AdminLevel] >= 1)
- {
- new oldpass[128];
- oldpass = strtok(cmdtext, idx);
- if(!strlen(oldpass)) return SendClientMessage(playerid, ORANGE, "USAGE: /changepassword [CURRENT PASSWORD] [new password]");
- if (strcmp(MD5_Hash(oldpass), AccountInfo[playerid][Password], true)) return SendClientMessage(playerid, RED, "Invalid password.");
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /changepassword [current password] [NEW PASSWORD]");
- format(oldpass, 128, "|- You've changed your password to '%s' -|", tmp);
- SendClientMessage(playerid, LIGHTGREEN, oldpass);
- strmid(AccountInfo[playerid][Password], MD5_Hash(tmp), 0, strlen(MD5_Hash(tmp)), 128);
- }
- return 1;
- }
- /* [WRONG COMMAND] */
- else
- {
- for(new i = 0; i < GetMaxPlayers(); i++)
- {
- if (IsPlayerConnected(i))
- {
- if (AccountInfo[i][AdminLevel] > 0 && ViewCmds[i] == 1)
- {
- GetPlayerName(playerid, sendername, sizeof sendername);
- format(tmp, 128, "[VIEWCMDS] [%d]%s: %s", playerid, sendername, cmdtext);
- SendClientMessage(i, PURPLE, tmp);
- }
- }
- }
- return 0;
- }
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- Cursor_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- if (SuperPunch[playerid] == 1)
- {
- if (GetPlayerState(playerid) != 2)
- {
- if (newkeys & KEY_FIRE && Drugs[playerid] == 0)
- {
- new Float:X,Float:Y,Float:Z,Float:Health;
- GetPlayerHealth(playerid,Health);
- if (GetPlayerWeapon(playerid) == 0)
- {
- GetPlayerPos(playerid,X,Y,Z);
- CreateExplosion(X,Y,Z,7,7.0);
- SetPlayerHealth(playerid,Health);
- }
- }
- else if (newkeys & KEY_FIRE && Drugs[playerid] == 1)
- {
- new Float:X,Float:Y,Float:Z;
- if (GetPlayerWeapon(playerid) == 0)
- {
- SetPlayerHealth(playerid,999999999);
- GetPlayerPos(playerid,X,Y,Z);
- CreateExplosion(X,Y,Z,7,7.0);
- SetPlayerHealth(playerid,999999999);
- }
- }
- }
- }
- }
- OnPlayerJailed(playerid)
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerPos(playerid, 264.3700,77.5700,1001.0391);
- SetPlayerFacingAngle(playerid, 272.6900);
- TogglePlayerControllable(playerid, 0);
- return 1;
- }
- OnPlayerUnjailed(playerid)
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerPos(playerid, 266.9272,78.6098,1001.0391);
- SetPlayerFacingAngle(playerid, 266.9169);
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- public CountDown()
- {
- if (Count > 0)
- {
- new str[5];
- format(str, sizeof str, "~w~%d", Count);
- GameTextForAll(str,2500,3);
- Count--;
- SetTimer("CountDown",1000,0);
- }
- else
- {
- GameTextForAll("~g~~h~Go ~w~!!",2500,3);
- Count = 999;
- }
- return 1;
- }
- public OnPlayerPrivmsg(playerid, recieverid, text[])
- {
- if (PMBlock[recieverid] == true) return SendClientMessage(playerid, RED, "That admin has blocked private messages"), 0;
- return 1;
- }
- forward NukeBlast(playerid, times, Float:X,Float:Y,Float:Z,Float:A);
- public NukeBlast(playerid, times, Float:X,Float:Y,Float:Z,Float:A)
- {
- if (Nuke[playerid] == times+1) return 1;
- //printf("Nukeblast %d",Nuke[playerid]);
- new Float:x,Float:y;
- x = X + ((10*Nuke[playerid]) * floatsin(-A+5, degrees));
- y = Y + ((10*Nuke[playerid]) * floatcos(-A+5, degrees));
- CreateExplosion(x, y, Z, 3, 3.0);
- Nuke[playerid]++;
- SetTimerEx("NukeBlast", 200, 0, "ddffff",playerid, times, X, Y, Z, A);
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- for(new i; i < MAX_PLAYERS; i++) if (objectid == Missile[i])
- {
- new Float:X,Float:Y,Float:Z,Float:x,Float:y,Float:z;
- GetObjectPos(objectid, X, Y, Z);
- GetObjectPos(objectid, x, y, z);
- DestroyObject(objectid);
- CreateExplosion(X, Y, Z, 7, 5);
- //front
- X += (5.0 * floatsin(0, degrees));
- Y += (5.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (3.0 * floatsin(0+45, degrees));
- Y += (3.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (3.0 * floatsin(0-45, degrees));
- Y += (3.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //right-left
- X += (5.0 * floatcos(0, degrees));
- Y += (5.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //back
- X -= (5.0 * floatcos(0, degrees));
- Y -= (5.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (5.0 * floatsin(0, degrees));
- Y -= (5.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (3.0 * floatsin(0+45, degrees));
- Y -= (3.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (3.0 * floatsin(0-45, degrees));
- Y -= (3.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- SetTimerEx("MissileExplosion", 700, 0, "fffd", x, y, z, 3);
- break;
- }
- }
- forward MissileExplosion(Float:X, Float:Y, Float:Z, times);
- public MissileExplosion(Float:X, Float:Y, Float:Z, times)
- {
- new Float:x = X;
- new Float:y = Y;
- new Float:z = Z;
- if (times == 3)
- {
- //front
- X += (10.0 * floatsin(0, degrees));
- Y += (10.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (6.0 * floatsin(0+45, degrees));
- Y += (6.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (6.0 * floatsin(0-45, degrees));
- Y += (6.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //right-left
- X += (10.0 * floatcos(0, degrees));
- Y += (10.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //back
- X -= (10.0 * floatcos(0, degrees));
- Y -= (10.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (10.0 * floatsin(0, degrees));
- Y -= (10.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (6.0 * floatsin(0+45, degrees));
- Y -= (6.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (6.0 * floatsin(0-45, degrees));
- Y -= (6.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- }
- else if (times == 2)
- {
- //front
- X += (15.0 * floatsin(0, degrees));
- Y += (15.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (9.0 * floatsin(0+45, degrees));
- Y += (9.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (9.0 * floatsin(0-45, degrees));
- Y += (9.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //right-left
- X += (15.0 * floatcos(0, degrees));
- Y += (15.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //back
- X -= (15.0 * floatcos(0, degrees));
- Y -= (15.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (15.0 * floatsin(0, degrees));
- Y -= (15.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (9.0 * floatsin(0+45, degrees));
- Y -= (9.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (9.0 * floatsin(0-45, degrees));
- Y -= (9.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- }
- else if (times == 1)
- {
- //front
- X += (20.0 * floatsin(0, degrees));
- Y += (20.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (12.0 * floatsin(0+45, degrees));
- Y += (12.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X += (12.0 * floatsin(0-45, degrees));
- Y += (12.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //right-left
- X += (20.0 * floatcos(0, degrees));
- Y += (20.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- //back
- X -= (20.0 * floatcos(0, degrees));
- Y -= (20.0 * floatsin(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (20.0 * floatsin(0, degrees));
- Y -= (20.0 * floatcos(0, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (12.0 * floatsin(0+45, degrees));
- Y -= (12.0 * floatcos(0+45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- X -= (12.0 * floatsin(0-45, degrees));
- Y -= (12.0 * floatcos(0-45, degrees));
- CreateExplosion(X, Y, Z, 7, 5);
- }
- if (times > 0) SetTimerEx("MissileExplosion", 700, 0, "fffd", x, y, z, times-1);
- }
- forward PushPlayer(playerid, distance, zup);
- public PushPlayer(playerid, distance, zup)
- {
- new Float:X,Float:Y,Float:Z,Float:A;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- if (zup == 1) SetPlayerPos(playerid, X, Y, Z+5);
- GetPlayerPos(playerid, X, Y, Z);
- X -= (2.0 * floatsin(-A, degrees));
- Y -= (2.0 * floatcos(-A, degrees));
- SetPlayerPos(playerid, X, Y, Z);
- if (distance > 0) SetTimerEx("PushPlayer", 100, 0, "ddd", playerid, distance-1, 0);
- }
- stock GetVehicleModelIDFromName(vehname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if (strfind(VehNames[i], vehname, true) != -1) return i + 400;
- }
- return -1;
- }
- stock GetWeaponModelIDFromName(weapname[])
- {
- for(new i = 0; i < 48; i++)
- {
- if (i == 19 || i == 20 || i == 21) continue;
- if (strfind(WeapNames[i], weapname, true) != -1) return i;
- }
- return -1;
- }
- stock bigstrtok(const string[], &idx)
- {
- new length = strlen(string);
- while ((idx < length) && (string[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = string[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- return result;
- }
- public ShowLoginMenu(playerid)
- {
- TextDrawShowForPlayer(playerid, Nick);
- TextDrawShowForPlayer(playerid, PasswordKey);
- TextDrawShowForPlayer(playerid, Login);
- TextDrawShowForPlayer(playerid, Name[playerid]);
- TextDrawShowForPlayer(playerid, Pass[playerid]);
- }
- public HideLoginMenu(playerid)
- {
- TextDrawHideForPlayer(playerid, Nick);
- TextDrawHideForPlayer(playerid, PasswordKey);
- TextDrawHideForPlayer(playerid, Login);
- TextDrawHideForPlayer(playerid, Name[playerid]);
- TextDrawHideForPlayer(playerid, Pass[playerid]);
- }
- public LogIn(playerid)
- {
- AccountInfo[playerid][Logged] = 1;
- HideLoginMenu(playerid);
- HideButton(PassClickBox_Suc, playerid);
- MenuShown[playerid] = false;
- }
- public OnPlayerClickCursor(playerid, Float:x, Float:y)
- {
- if (CursorInBox(playerid, PassClickBox) || CursorInBox(playerid, PassClickBox_Fail))
- {
- OnPlayerLogin(playerid, MD5_Hash(PassBox[playerid]));
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement