Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================//
- /*
- ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- JaKe's Administration System 3.3 Patch I [NEW ERA] - Scripted from scratch!
- Scripted by Jake Hero.
- Never been bitter.
- NOTE: Lots of changes has been made on 3.3, Please remove all the old datas from the scriptfiles of JakAdmin that uses 3.2 and below.
- //Ignore the note on the new patch if you have already used JakAdmin3.3.
- NOTE2: Delete the juser.db, a new row in the .db file has been added.
- Changelog since JakAdmin3 Patch I:
- • Security Updates for Patch I.
- • Major bug fixes on the script core which isn't discovered in early beta testing.
- • A large/huge error on coding the database has been sealed and fixed (IMPORTANT)
- • Security Question for the player's account has been implemented back.
- • More better and accurate Security Question than JakAdmin 3.2.
- • A typo on the print message which displays '2014' instead of '2015', It has been updated.
- • Added a check folder script to avoid the server crash.
- • Added a Restart Command which wasn't added on the early stages of JakAdmin3.
- • Some new commands besides of the Security Patch such as /carpjob.
- • A new updated version of OPRL provided by Lordzy.
- • Added an option on the command /login to type 'forget'.
- • Replaced the login's dialog 2nd option button from 'Quit' to 'Forget'
- • An error on inserting a new registered player through /register has been fixed and synced with the code from the dialog.
- • Replaces some parts of the script which uses standard loop with the foreach.
- • Improved SQL Injection Protection on the Player Database.
- • Added a code which prevents from anyone using SQL Injection on the ban database.
- • Extended string for /jacmds.
- Credits goes to: Zeex, SA-MP Team, Y_Less, Lordzy and for everyone who helped me on beta testing.
- ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- */
- //============================================================================//
- //JakAdmin Includes
- #include <a_samp>
- //#include <a_whirlpool>
- native WP_Hash(buffer[], len, const str[]);
- #include <zcmd>
- #include <sscanf2>
- #include <foreach>
- #include <YSI\y_scripting>
- #pragma dynamic 39470
- //============================================================================//
- //Variables, Defnes and other stuffs starts here.
- stock
- st[100]
- ;
- //Public Macro
- #define function:%0(%1)\
- forward %0(%1);\
- public %0(%1)
- //Level Check Macro
- //Level Check Macro
- #define LevelCheck(%0,%1); \
- if(User[(%0)][accountAdmin] < %1 && !IsPlayerAdmin((%0)))\
- return format(st, 100, "Du musst den admin level %d besitzen um diesen Befehl auszuführen.", (%1)),\
- SendClientMessage((%0), -1, st);
- //Login Check Macro
- #define LoginCheck(%1) if(User[%1][accountLogged] == false) return SendClientMessage(%1, COLOR_RED, "Du musst eingeloggt sein um diesen Befehl auszuführen.")
- //Do not change the file type to .ini, We uses SQLite.
- #define _DB_ "JakAdmin3/Spieler.db"
- //The location and folder has been changed on 3.3.
- #define _LOG_ "JakAdmin3/Logs/"
- //The location and folder for the log has been also changed on 3.3.
- new _God[MAX_PLAYERS];
- new reportmsg[4][136];
- new SpecInt[MAX_PLAYERS][2];
- new Float:SpecPos[MAX_PLAYERS][4];
- new GameTimer[MAX_PLAYERS];
- new VehicleNames[212][] = {
- {"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"},{"Previon"},
- {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
- {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"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"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
- {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
- {"Tanker"}, {"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"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
- {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
- {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
- {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
- {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
- {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
- {"Trailer 3"},{"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"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
- {"Utility Trailer"}
- };
- //Configuration
- #define VERSION "3.3 Patch I"
- #define ADMIN_SPEC_TYPE_NONE 0
- #define ADMIN_SPEC_TYPE_PLAYER 1
- #define ADMIN_SPEC_TYPE_VEHICLE 2
- #define STARTING_SCORE 1
- //Starting score for registered player.
- #define STARTING_CASH 10000
- //Starting cash for registered player.
- #define MAX_RCON_WARNINGS 3
- //Max warnings for attempting to logged in RCON.
- //Change the starting score and starting cash.
- #define LOG true
- //Change to false if you want to disable making logs on the server (Such as saving kicks etc, ban messages).
- #define AUTO_LOGIN true
- //Change to false if you want to disable the auto-login system.
- #define REGISTER_DIALOG true
- //Change to false if you want to disable the register/login dialog.
- #define READ_COMMANDS true
- //Change to false if you want to disable reading all player commands.
- #define MAX_PING false
- //Change to false if you want to disable this system.
- #define ANTI_SWEAR true
- //Change to false if you want to disable the AntiSwear.
- #define ANTI_NAME true
- //Change to false if you want to disable the AntiName.
- #define ANTI_SPAWN true
- //Change to false if you want to disable.
- //Anti Spawn disables player from spawning if they aren't registered or logged in.
- #define ANTI_AD true
- //Change to false if you want to disable the anti ad.
- #define RconProtect true
- //Change to false if you want to disable the 2nd Rcon.
- #define AntiSpam true
- //Change to false if you want to disable the AntiSpam.
- #define ReportTD true
- //Change to false if you want to disable the textdraw.
- #if ReportTD == true
- new Text:Textdraw0;
- #endif
- enum PlayerInfo
- {
- accountID,
- accountName[24],
- accountIP[20],
- accountQuestion[129],
- accountAnswer[129],
- accountPassword[129],
- accountAdmin,
- accountKills,
- accountDeaths,
- accountScore,
- accountCash,
- bool: accountLogged,
- WarnLog,
- accountDate[150],
- accountWarn,
- accountMuted,
- accountMuteSec,
- accountCMuted,
- accountCMuteSec,
- accountJail,
- accountJailSec,
- SpecID,
- SpecType,
- pCar,
- accountGame[3],
- pDuty,
- #if AntiSpam == true
- SpamCount,
- SpamTime
- #endif
- };
- new User[MAX_PLAYERS][PlayerInfo],
- DB:Database,
- static_Warn[MAX_PLAYERS]
- ;
- #if AntiSpam == true
- #define SPAM_MAX_MSGS 5 // Max Spam Messages
- #define SPAM_TIMELIMIT 8 // In seconds
- #endif
- #if RconProtect == true
- #include <OPRL>
- //Includes the OPRL by Lordzy if 2nd_Rcon is set to true.
- #define RconPass "changeme"
- //Password for the 2nd Rcon, changeme to anything you want.
- new bool:_RCON[MAX_PLAYERS];
- new _RCONwarn[MAX_PLAYERS];
- #endif
- #if ANTI_NAME == true
- new ForbidNames[][] =
- {
- {"Admin"},
- {"AssLicker"},
- {"Vip"},
- {"Hacker"},
- {"Justin_Bieber"},
- {"Supporter"},
- {"Projektleiter"},
- {"High-Admin"}
- //Names here, Remember, the last stanza don't have ","
- };
- #endif
- #if ANTI_SWEAR == true
- new Swears[][] =
- {
- {"dick"},
- {"pussy"},
- {"dildo"},
- {"adventure time gay"},
- {"dik"},
- {"penis"},
- {"lutschen"},
- {"Hurensohn"},
- {"nN"},
- {"Homo"}
- //Bad Words here, Remember, the last stanza don't have ","
- };
- #endif
- #if MAX_PING == true
- #define PING_EXCEED 1000
- //Maximum ping if the MAX_PING is set to true, if player exceeds it, He or SHE gets kicked.
- #define MAX_PING_WARN 3
- //Max ping warning from Ping Kick, once exceed, player gets kicked.
- #endif
- //JakAdmin3 now makes everything easy.
- #define SD ShowPlayerDialog
- #define DP DIALOG_STYLE_PASSWORD
- #define DI DIALOG_STYLE_INPUT
- #define DM DIALOG_STYLE_MSGBOX
- #define DL DIALOG_STYLE_LIST
- //Dialog Begin is null, You can use it as a message displayer since it is not used.
- #define DIALOG_BEGIN 905
- //Change the dialog id of the DIALOG_BEGIN if it conflicts.
- #define DIALOG_REGISTER DIALOG_BEGIN+1
- #define DIALOG_LOGIN DIALOG_BEGIN+2
- #define DIALOG_COLORS DIALOG_BEGIN+3
- #define DIALOG_RCON DIALOG_BEGIN+4
- #define DIALOG_QUESTION DIALOG_BEGIN+5
- #define DIALOG_ANSWER DIALOG_BEGIN+6
- #define DIALOG_FORGET DIALOG_BEGIN+7
- //Colors
- #define white "{FFFFFF}"
- #define lightblue "{33CCFF}"
- #define grey "{AFAFAF}"
- #define orange "{FF8000}"
- #define black "{2C2727}"
- #define red "{FF0000}"
- #define yellow "{FFFF00}"
- #define green "{33CC33}"
- #define blue "{0080FF}"
- #define purple "{D526D9}"
- #define pink "{FF80FF}"
- #define brown "{A52A2A}"
- #define COLOR_RED 0xFF0000C8
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GREEN 0x33CC33C8
- #define COLOR_ORANGE 0xFF8000C8
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_PURPLE 0xD526D9FF
- #define COLOR_LIGHTGREEN 0x00FF00FF
- #define COLOR_PINK 0xFF80FFFF
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_BLUE 0x0080FFC8
- #define COLOR_BROWN 0xA52A2AAA
- #define COLOR_BLACK 0x2C2727AA
- //============================================================================//
- //Script line starts here
- public OnFilterScriptInit()
- {
- new
- day,
- month,
- year,
- hour,
- sec,
- mins,
- result = GetTickCount()
- ;
- getdate(year, month, day);
- gettime(hour, mins, sec);
- /*
- Checks the JakAdmin3 and logs folder if exist, otherwise sends a print message.
- */
- checkfolder();
- /*
- Just so you know, even if the folders of JakAdmin3 is missing, nothing will happen except
- accounts won't save. We have also blocked the SaveLog function from overwriting files
- when the Logs folder is missing.
- */
- if(checkfolderEx() == 1)
- {
- /*
- If CheckFolderEX returns 1 instead of 0 (Doesn't exist), proceed the daily route.
- */
- printf("\nLolbob %s (c), Copyright - 2015", VERSION);
- print("Security Updates for SQL Injection, Patch I\n");
- //Load the .DB file.
- loadb();
- printf("[Lolbob] Duration: %i ms", (GetTickCount() - result));
- printf("[Lolbob] Total Commands: %i", j_CountCmds());
- printf("[Lolbob] Date: %02i/%02i/%02i | Time: %02d:%02d:%02d", day, month, year, hour, mins, sec);
- Config();
- print("\n");
- //Syncing Timers
- SetTimer("SyncStats", 1000, true);
- //Ping Timer (if set to true)
- #if MAX_PING == true
- SetTimer("PingCheck", 1000, true);
- #endif
- //Punishment Timer Handler
- SetTimer("PunishmentHandle", 1000, true);
- for(new i=0; i<4; i++)
- {
- format(reportmsg[i], 136, "None");
- }
- #if ReportTD == true
- Textdraw0 = TextDrawCreate(400.000000, 386.000000, "~r~New Report! ~w~Check your ~g~chat ~w~or ~y~/reports~w~!");
- TextDrawBackgroundColor(Textdraw0, 255);
- TextDrawFont(Textdraw0, 1);
- TextDrawLetterSize(Textdraw0, 0.320000, 1.100000);
- TextDrawColor(Textdraw0, -1);
- TextDrawSetOutline(Textdraw0, 1);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetSelectable(Textdraw0, 0);
- #endif
- foreach(new i : Player)
- {
- OnPlayerConnect(i);
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- //Closing the .DB file.
- closedb();
- #if ReportTD == true
- TextDrawDestroy(Textdraw0);
- #endif
- foreach(new i : Player)
- {
- if(User[i][pCar] != -1)
- {
- DestroyVehicle(User[i][pCar]);
- }
- OnPlayerDisconnect(i, 1);
- User[i][accountLogged] = false;
- }
- return 1;
- }
- #if MAX_PING == true
- function:PingCheck()
- {
- new
- string[130]
- ;
- foreach(new i : Player)
- {
- if(GetPlayerPing(i) > PING_EXCEED)
- {
- if(static_Warn[i] == MAX_PING_WARN)
- {
- format(string, sizeof(string), "** %s(ID:%d) wurde vom Server gekickt [Grund: Maximum Ping Limit] (Ping: %d | Maximum Ping: %d)", pName(i), i, GetPlayerPing(i), PING_EXCEED);
- SendClientMessageToAll(COLOR_GREY, string);
- KickDelay(i);
- return 1;
- }
- static_Warn[i] ++;
- format(string, sizeof(string), "** %s(ID:%d) hat einen Ping Kick Warning erhalten (Ping: %d | Maximum Ping: %d) (Warnungen: %d/%d)", pName(i), i, GetPlayerPing(i), PING_EXCEED, static_Warn[i], MAX_PING_WARN);
- SendClientMessageToAll(COLOR_YELLOW, string);
- }
- }
- return 1;
- }
- #endif
- function:SyncStats()
- {
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- User[i][accountCash] = GetPlayerMoney(i);
- User[i][accountScore] = GetPlayerScore(i);
- }
- //Will be using for god too. (Improving it on the next version)
- if(_God[i] == 1)
- {
- SetPlayerHealth(i, 100000);
- }
- }
- return 1;
- }
- function:GamePlay(playerid)
- {
- if(User[playerid][accountLogged] == true)
- {
- User[playerid][accountGame][0] += 1;
- if(User[playerid][accountGame][0] == 60)
- {
- User[playerid][accountGame][0] = 0;
- User[playerid][accountGame][1] += 1;
- if(User[playerid][accountGame][1] >= 59 && User[playerid][accountGame][0] == 0)
- {
- User[playerid][accountGame][1] = 0;
- User[playerid][accountGame][2] += 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- #if ANTI_NAME == true
- new string[128+40];
- for(new x = 0; x < sizeof(ForbidNames); x++)
- {
- if(!strcmp(pName(playerid), ForbidNames[x], true))
- {
- format(string, sizeof string, "** Player %s(ID:%d) wurde vom Server gekickt (Verbotener Name)", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_GREY, string);
- printf(string);
- #if LOG == true
- SaveLog("kicklog.txt", string);
- #endif
- KickDelay(playerid);
- return 1;
- }
- }
- #endif
- for(new x; x < _: PlayerInfo; ++x ) User[playerid][PlayerInfo: x] = 0;
- User[playerid][SpecID] = INVALID_PLAYER_ID;
- #if RconProtect == true
- _RCON[playerid] = false;
- _RCONwarn[playerid] = 0;
- #endif
- User[playerid][pDuty] = 0;
- User[playerid][pCar] = -1;
- #if AntiSpam == true
- User[playerid][SpamCount] = 0;
- User[playerid][SpamTime] = 0;
- #endif
- _God[playerid] = 0;
- GetPlayerName(playerid, User[playerid][accountName], MAX_PLAYER_NAME);
- GetPlayerIp(playerid, User[playerid][accountIP], 20);
- static_Warn[playerid] = 0;
- new
- bQuery[128+90],
- reason[128],
- admin[128],
- when[128],
- DBResult:jResult
- ;
- format(bQuery, 600, "SELECT * FROM `bans` WHERE `username` = '%s'", pName(playerid));
- jResult = db_query(Database, bQuery);
- if(db_num_rows(jResult))
- {
- db_get_field_assoc(jResult, "banby", admin, 128);
- db_get_field_assoc(jResult, "banreason", reason, 128);
- db_get_field_assoc(jResult, "banwhen", when, 128);
- ShowBan(playerid, admin, reason, when);
- KickDelay(playerid);
- return 1;
- }
- db_free_result(jResult);
- new
- Query[128+71],
- DBResult: Result
- ;
- #if AUTO_LOGIN == true
- new fIP[20];
- #endif
- #if ReportTD == true
- TextDrawHideForPlayer(playerid, Textdraw0);
- #endif
- GameTimer[playerid] = SetTimerEx("GamePlay", 1000, true, "d", playerid);
- #if AUTO_LOGIN == true
- format(Query, sizeof(Query), "SELECT `password`, `IP` FROM `users` WHERE `username` = '%s'", DB_Escape(User[playerid][accountName]));
- Result = db_query(Database, Query);
- #else
- format(Query, sizeof(Query), "SELECT `password` FROM `users` WHERE `username` = '%s'", DB_Escape(User[playerid][accountName]));
- Result = db_query(Database, Query);
- #endif
- if(db_num_rows(Result))
- {
- SendClientMessage(playerid, -1, "Dein Account wurde in der Datenbank gefunden");
- db_get_field_assoc(Result, "password", User[playerid][accountPassword], 129);
- db_get_field_assoc(Result, "question", User[playerid][accountQuestion], 129);
- db_get_field_assoc(Result, "answer", User[playerid][accountAnswer], 129);
- #if AUTO_LOGIN == true
- db_get_field_assoc(Result, "IP", fIP, 20);
- if(strcmp(fIP, User[playerid][accountIP], true) == 0)
- {
- SendClientMessage(playerid, -1, "Du wirst nun automatisch eingeloggt.");
- LoginPlayer(playerid);
- }
- else
- {
- #if REGISTER_DIALOG == true
- SD(playerid, DIALOG_LOGIN, DP, ""lightblue"Real-Shit City", ""grey"Willkommen auf Real-Shit City!\nDein Account wurde in der Datenbank gefunden\ngib dein Passwort niemals weiter, auch nicht an Admins oder Supporter! \n\nTIPS: Du kannst dich nun einloggen. Bitte gib dein Passwort ein.", "Login", "Forget");
- #else
- SendClientMessage(playerid, COLOR_ORANGE, "Real-Shit City: /login [password] um dich einzuloggen.");
- #endif
- }
- #else
- #if REGISTER_DIALOG == true
- SD(playerid, DIALOG_LOGIN, DP, ""lightblue"Real-Shit City", ""grey"Willkommen auf Real-Shit City!\nDein Account wurde in der Datenbank gefunden\ngib dein Passwort niemals weiter, auch nicht an Admins oder Supporter! \n\nTIPS: Du kannst dich nun einloggen. Bitte gib dein Passwort ein.", "Login", "Forget");
- #else
- SendClientMessage(playerid, COLOR_ORANGE, "LOGIN: /login [password] um dich einzuloggen.");
- #endif
- #endif
- }
- else
- {
- SendClientMessage(playerid, -1, "Dein Account wurde nicht in der Datenbank gefunden");
- #if REGISTER_DIALOG == true
- SD(playerid, DIALOG_REGISTER, DP, ""lightblue"Herzlich Willkommen auf Real-Shit City", ""grey"nIch sehe du bist neu auf diesem Server, bitte trage dein gewünschtes passwort ein.", "Register", "Quit");
- #else
- SendClientMessage(playerid, COLOR_ORANGE, "Real-Shit City: /register [password] um dir ein Account zu erstellen.");
- #endif
- }
- db_free_result(Result);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- #if ReportTD == true
- TextDrawHideForPlayer(playerid, Textdraw0);
- #endif
- for(new x=0; x<MAX_PLAYERS; x++)
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
- AdvanceSpectate(x);
- if(User[playerid][pCar] != -1) EraseVeh(User[playerid][pCar]);
- KillTimer(GameTimer[playerid]);
- if(User[playerid][accountLogged] == true)
- {
- //Saves the statistics to the .db.
- SaveData(playerid);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(User[playerid][accountJail] == 1)
- {
- SetTimerEx("JailPlayer", 3000, 0, "d", playerid);
- SendClientMessage(playerid, COLOR_RED, "Strafe: Du kannst deiner Strafe nicht entgehen. Du bist immer noch im Prison, Haha!");
- return 1;
- }
- return 1;
- }
- function:JailPlayer(playerid)
- {
- new string[128];
- SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
- SetPlayerInterior(playerid, 3);
- SetCameraBehindPlayer(playerid);
- format(string, 200, "Du wurdest für %d sekunden ins Prison gesteckt.", User[playerid][accountJailSec]);
- SendClientMessage(playerid, COLOR_RED, string);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- for(new x=0; x<MAX_PLAYERS; x++)
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
- AdvanceSpectate(x);
- User[playerid][accountDeaths] ++;
- if(killerid != INVALID_PLAYER_ID)
- {
- User[killerid][accountKills] ++;
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- foreach(new i : Player)
- {
- if(vehicleid == User[i][pCar])
- {
- EraseVeh(vehicleid);
- User[i][pCar] = -1;
- }
- }
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new string[128+50];
- #if ANTI_AD == true
- if(strfind(text, ":", true) != -1)
- {
- new
- i_numcount,
- i_period,
- i_pos;
- while(text[i_pos]) {
- if('0' <= text[i_pos] <= '9') i_numcount++;
- else if(text[i_pos] == '.') i_period++;
- i_pos++;
- }
- if(i_numcount >= 8 && i_period >= 3)
- {
- format(string, sizeof(string), "Werbung: Spieler %s(ID: %d) vielleicht Server Werbung: '%s'.", pName(playerid), playerid, text);
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountAdmin] >= 1)
- {
- SendClientMessage(i, COLOR_RED, string);
- }
- }
- }
- SendClientMessage(playerid, -1, "Dein Chat wurde gesendet.");
- return 0;
- }
- }
- #endif
- if(User[playerid][accountMuted] == 1)
- {
- format(string, sizeof(string), "Du bist immernoch gemuted, Du kannst nach %d sekunden wieder reden.", User[playerid][accountMuteSec]);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- return 0;
- }
- #if AntiSpam == true
- if((User[playerid][accountAdmin] == 0 && !IsPlayerAdmin(playerid)))
- {
- if(User[playerid][SpamCount] == 0) User[playerid][SpamTime] = TimeStamp();
- User[playerid][SpamCount]++;
- if(TimeStamp() - User[playerid][SpamTime] > SPAM_TIMELIMIT)
- {
- User[playerid][SpamCount] = 0;
- User[playerid][SpamTime] = TimeStamp();
- }
- else if(User[playerid][SpamCount] == SPAM_MAX_MSGS)
- {
- format(string, sizeof(string), "** Spieler %s (ID:%d) wurde vom Server gekickt Grund (Spam Schutz)", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_GREY, string);
- print(string);
- #if LOG == true
- SaveLog("kicklog.txt", string);
- #endif
- KickDelay(playerid);
- }
- else if(User[playerid][SpamCount] == SPAM_MAX_MSGS-1)
- {
- SendClientMessage(playerid, COLOR_RED, "WARNUNG: Anti Spam Warnung! Nochmal und du bekommst ein Kick!");
- return 0;
- }
- }
- #endif
- #if ANTI_SWEAR == true
- for(new i = 0; i < sizeof(Swears); i++)
- {
- Cenzura(text, Swears[i]);
- }
- #endif
- return 1;
- }
- //============================================================================//
- // ZCMD //
- public OnPlayerCommandReceived(playerid, cmdtext[])
- {
- new string[128+50];
- #if ANTI_AD == true
- if(strfind(cmdtext, ":", true) != -1)
- {
- new
- i_numcount,
- i_period,
- i_pos;
- while(cmdtext[i_pos]) {
- if('0' <= cmdtext[i_pos] <= '9') i_numcount++;
- else if(cmdtext[i_pos] == '.') i_period++;
- i_pos++;
- }
- if(i_numcount >= 8 && i_period >= 3)
- {
- format(string, sizeof(string), "Werbung: Spieler %s(ID: %d) vielleicht Server Werbung: '%s'.", pName(playerid), playerid, cmdtext);
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountAdmin] >= 1)
- {
- SendClientMessage(i, COLOR_RED, string);
- }
- }
- }
- SendClientMessage(playerid, -1, "Dein Befehl wurde erfolgreich gesendet.");
- return 0;
- }
- }
- #endif
- if(User[playerid][accountCMuted] == 1)
- {
- format(string, sizeof(string), "Du bist immer noch gemuted, Du kannst alle Befehle nach %d sekunden wieder benutzen.", User[playerid][accountCMuteSec]);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- return 0;
- }
- #if READ_COMMANDS == true
- format(string, sizeof(string), "*** %s(ID:%d) : '%s'", pName(playerid), playerid, cmdtext);
- foreach(new i : Player)
- {
- if(User[i][accountAdmin] >= 1 && User[i][accountAdmin] > User[playerid][accountAdmin] && i != playerid)
- {
- SendClientMessage(i, COLOR_GREY, string);
- }
- }
- #endif
- return 1;
- }
- //============================================================================//
- // Administrative Level 1-5 //
- //============================================================================//
- CMD:jacmds(playerid, params[])
- {
- new string[1246+200];
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- strcat(string, ""orange"");
- strcat(string, "Auflistung aller benutzbaren Befehle für dein Admin-Rang.\n\n");
- if(User[playerid][accountAdmin] >= 1)
- {
- strcat(string, ""lightblue">>> Supporter <<<\n");
- strcat(string, ""grey"");
- strcat(string, "/Durchsage /Kick /Antwort /goto /ip /spawn /gotoco\n");
- strcat(string, "/repair /reports /aduty /waffen /a(Admin Chat\n");
- strcat(string, "/takew /tv(off) /car /fluestern\n\n");
- }
- if(User[playerid][accountAdmin] >= 2)
- {
- strcat(string, ""lightblue">>> Moderator <<<\n");
- strcat(string, ""grey"");
- strcat(string, "/setinterior /heal /clearchat /(un)Prison\n");
- strcat(string, "/alltp /tpspieler /armour /respawncars\n");
- strcat(string, "/awaffen /tp\n\n");
- }
- if(User[playerid][accountAdmin] >= 3)
- {
- strcat(string, ""lightblue">>> Admin <<<\n");
- strcat(string, ""grey"");
- strcat(string, "/(un)ban (/un)freeze /geldentf /armourall /mute\n");
- strcat(string, "/armourall /sethealth /gibwaffen /healall /warn\n");
- strcat(string, "/write /warnentf /unmute\n\n");
- }
- if(User[playerid][accountAdmin] >= 4)
- {
- strcat(string, ""lightblue">>> Stellvertretender <<<\n");
- strcat(string, ""grey"");
- strcat(string, "/setweather /settime /allwaffen\n");
- strcat(string, "/ageld /alevel /setinterior /awaffenentf\n");
- strcat(string, "/allkill /restart /akick\n\n");
- }
- if(User[playerid][accountAdmin] >= 5 || IsPlayerAdmin(playerid))
- {
- strcat(string, ""lightblue">>> Projektleiter <<<\n");
- strcat(string, ""grey"");
- strcat(string, "/explode /ipban /acctot /jetpack\n");
- strcat(string, "/setlevel /setgeld /aexplode\n\n");
- }
- SD(playerid, DIALOG_BEGIN, DM, ""orange"Administrative Befehle", string, "Verlassen", "");
- return 1;
- }
- //============================================================================//
- // Administrative Level One //
- //============================================================================//
- CMD:car(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new carID[50], car, colour1, colour2, string[128];
- if(sscanf(params, "s[50]I(255)I(255)", carID, colour1, colour2)) return SendClientMessage(playerid, COLOR_RED, "/car [Car Name] [Farbe1(Optional)] [Farbe2(Optional)]");
- if(!isnumeric(carID)) car = GetVehicleModelIDFromName(carID);
- else car = strval(carID);
- if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Vehicle Model ID!");
- if(colour1==255) colour1=random(256);
- if(colour2==255) colour2=random(256);
- if(User[playerid][pCar] != -1 && !IsPlayerAdmin(playerid))
- EraseVeh(User[playerid][pCar]);
- new VehicleID;
- new Float:X, Float:Y, Float:Z;
- new Float:Angle, int1;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- int1 = GetPlayerInterior(playerid);
- VehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
- LinkVehicleToInterior(VehicleID, int1);
- SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
- User[playerid][pCar] = VehicleID;
- format(string, sizeof(string), "Du hast ein \"%s\" (Model: %d) gespawnt mit den Farben %d,%d", VehicleNames[car-400], car, colour1, colour2);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- return 1;
- }
- CMD:takew(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- string[130],
- id
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/takew [spielerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die höheren rang als du haben.");
- ResetPlayerWeapons(id);
- format(string, sizeof(string), "Du hast die Waffen von %s's weggenommen.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s hat dir deine Waffen weggenommen.", pName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:fluestern(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new Player, Show[129];
- if(sscanf(params, "us[129]", Player, Show)) return SendClientMessage(playerid, COLOR_RED, "/fluestern [spielerid] [text]");
- if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- GameTextForPlayer(Player, Show, 6000, 3);
- new string[120];
- format(string, sizeof(string), "Screen text sent to %s(ID:%d).", pName(Player), Player);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s(ID:%d) fluester mit dir.", pName(playerid), playerid);
- SendClientMessage(Player, COLOR_YELLOW, string);
- return 1;
- }
- CMD:tv(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new string[150], specplayerid;
- if(sscanf(params, "u", specplayerid)) return SendClientMessage(playerid, COLOR_RED, "/Tv [playerid]");
- if(specplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
- if(User[playerid][accountAdmin] < User[specplayerid][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rang höher sind als du.");
- if(specplayerid == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst tvn.");
- if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && User[specplayerid][SpecID] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is spectating someone.");
- if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3) return SendClientMessage(playerid, COLOR_RED, "Spieler ist noch nicht gespawnt.");
- GetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
- GetPlayerFacingAngle(playerid, SpecPos[playerid][3]);
- SpecInt[playerid][0] = GetPlayerInterior(playerid);
- SpecInt[playerid][1] = GetPlayerVirtualWorld(playerid);
- StartSpectate(playerid, specplayerid);
- format(string, sizeof(string), "Now Spectating: %s (ID: %d)", pName(specplayerid), specplayerid);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- SendClientMessage(playerid, -1, "Drücke SHIFT für das erweiterte Tvn und SPACE für das normale Tvn.");
- return 1;
- }
- CMD:tvoff(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- if(User[playerid][SpecType] != ADMIN_SPEC_TYPE_NONE)
- {
- StopSpectate(playerid);
- SetTimerEx("PosAfterSpec", 3000, 0, "d", playerid);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "No longer spectating.");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Du Tvst keinen.");
- return 1;
- }
- CMD:waffen(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- id,
- Count,
- x,
- string[128],
- string2[64],
- WeapName[24],
- slot,
- weap,
- ammo
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/Waffen [spielerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
- format(string2, sizeof(string2), "_______ [ %s(ID:%d) Weapons ] _______", pName(id), id);
- SendClientMessage(playerid, COLOR_WHITE, string2);
- for(slot = 0; slot < 14; slot++)
- {
- GetPlayerWeaponData(id, slot, weap, ammo);
- if(ammo != 0 && weap != 0)
- Count++;
- }
- if(Count < 1) return SendClientMessage(playerid, COLOR_RED, "Der Spieler hat keine Waffen bei sich!");
- if(Count >= 1)
- {
- for (slot = 0; slot < 14; slot++)
- {
- GetPlayerWeaponData(id, slot, weap, ammo);
- if(ammo != 0 && weap != 0)
- {
- GetWeaponName(weap, WeapName, sizeof(WeapName));
- if(ammo == 65535 || ammo == 1)
- format(string, sizeof(string), "%s%s (1)",string, WeapName);
- else format(string, sizeof(string), "%s%s (%d)", string, WeapName, ammo);
- x++;
- if(x >= 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, string);
- x = 0;
- format(string, sizeof(string), "");
- }
- else format(string, sizeof(string), "%s, ", string);
- }
- }
- if(x <= 4 && x > 0)
- {
- string[strlen(string)-3] = '.';
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- }
- return 1;
- }
- CMD:aduty(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- string[128]
- ;
- switch(User[playerid][pDuty])
- {
- case 0:
- {
- User[playerid][pDuty] = 1;
- format(string, 128, "%s(ID:%d) geht in den \" Admin Mode \"", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_RED, string);
- }
- case 1:
- {
- User[playerid][pDuty] = 0;
- format(string, 128, "%s(ID:%d) verlässt den \" Admin Mode \"", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- }
- }
- return 1;
- }
- CMD:reports(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new string[1400], string2[136];
- strcat(string, ""red"*** Report Send by the Players ***\n\n");
- strcat(string, ""grey"");
- for(new i=0; i<4; i++)
- {
- format(string2, sizeof string2, "(%d) %s\n", i, reportmsg[i]);
- strcat(string, string2);
- }
- SD(playerid, DIALOG_BEGIN, DM, ""red"Reports", string, "Verlassen", "");
- return 1;
- }
- CMD:repair(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- if(IsPlayerInAnyVehicle(playerid))
- {
- new VehicleID = GetPlayerVehicleID(playerid);
- RepairVehicle(VehicleID);
- GameTextForPlayer(playerid, "~w~~n~~n~~n~~n~~n~~n~Vehicle ~g~Repaired!", 3000, 3);
- SetVehicleHealth(VehicleID, 1000.0);
- }
- else
- SendClientMessage(playerid, COLOR_RED, "Syntax Error: You must be inside of the vehicle to use this command.");
- return 1;
- }
- CMD:gotoco(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- Float: Pos[3],
- string[128]
- ;
- if(sscanf(params, "fff", Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /gotoco [x] [y] [z]");
- if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
- else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- format(string, sizeof string, "You have teleported to Coordinates %.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- CMD:ip(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- id,
- string[120]
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /ip [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- format(string, 120, "> %s's IP: %s <", pName(id), getIP(id));
- SendClientMessage(playerid, GetPlayerColor(id), string);
- return 1;
- }
- CMD:spawn(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- string[128],
- id
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /spawn [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- SetPlayerPos(id, 0.0, 0.0, 0.0);
- SpawnPlayer(id);
- format(string, sizeof(string), "You have respawned Player %s.", pName(id));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "Administrator %s has respawned you.", pName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:goto(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- id,
- string[130],
- Float:x,
- Float:y,
- Float:z
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /goto [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- GetPlayerPos(id, x, y, z);
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- if(GetPlayerState(playerid) == 2)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid), x+3, y, z);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(id));
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(id));
- }
- else SetPlayerPos(playerid, x+2, y, z);
- format(string, sizeof(string), "You have been teleported to Player %s.", pName(id));
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "Administrator %s has teleported to your location.", pName(playerid));
- SendClientMessage(id, COLOR_GREEN, string);
- return 1;
- }
- CMD:durchsage(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "/Durchsage [Nachricht an alle User]");
- GameTextForAll(params, 4000, 3);
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- string[128],
- id,
- reason[128]
- ;
- if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/kick [spielerid] [Grund(Standart: N/A)]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst keine Admins Kicken die Rang höher sind als du.");
- format(string, sizeof(string), "** %s wurde von den Adminstratoren für %s gekickt [Grund: %s]", pName(id), pName(playerid), reason);
- SendClientMessageToAll(COLOR_GREY, string);
- #if LOG == true
- SaveLog("kicklog.txt", string);
- #endif
- KickDelay(id);
- return 1;
- }
- CMD:antwort(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- new
- string[128]
- ;
- if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "/antwort [nachricht als Antwort im]");
- format(string, sizeof(string), "** Admin %s: %s", pName(playerid), params);
- SendClientMessageToAll(COLOR_GREEN, string);
- return 1;
- }
- CMD:a(playerid, params[])
- {
- new
- string[140]
- ;
- LoginCheck(playerid);
- LevelCheck(playerid, 1);
- if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "/a [admin chat]");
- format(string, sizeof( string ), "<!> Admin Chat %s: %s", pName(playerid), params);
- #if LOG == true
- SaveLog("adminchat.txt", string);
- #endif
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountAdmin] >= 1)
- {
- SendClientMessage(i, COLOR_YELLOW, string);
- }
- }
- }
- return 1;
- }
- //============================================================================//
- // Administrative Level Two //
- //============================================================================//
- CMD:aweapons(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- GivePlayerWeapon(playerid, 24, 99999);
- GivePlayerWeapon(playerid, 26, 99999);
- GivePlayerWeapon(playerid, 29, 99999);
- GivePlayerWeapon(playerid, 31, 99999);
- GivePlayerWeapon(playerid, 33, 99999);
- GivePlayerWeapon(playerid, 38, 99999);
- GivePlayerWeapon(playerid, 9, 1);
- SendClientMessage(playerid, COLOR_YELLOW, "Waffen von Admin %s erhalten!");
- return 1;
- }
- //----------------------------------Befehle die jeder Spieler benutzen kann--------------------------------------//
- CMD:eject(playerid, params[])
- {
- new string[130],
- id
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/eject [spielerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler befindet sich nicht in deinem Auto.");
- if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht in deinem Auto.");
- if(GetPlayerVehicleID(id) != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_RED, "Der Spieler ist nicht in deinem Auto.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "Du bist nicht der Fahrer dieses Fahrzeuges.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst ejecten.");
- RemovePlayerFromVehicle(id);
- format(string, sizeof(string), "Du hast den Spieler %s(ID:%d) von deinem Auto rausgeschmissen", pName(id), id);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- CMD:muteinfo(playerid, params[])
- {
- new string[128], count = 0;
- SendClientMessage(playerid, -1, "** "orange"Muted Players "white"**");
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountMuted] == 1)
- {
- format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountMuteSec]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- count++;
- }
- }
- }
- if(count == 0) return SendClientMessage(playerid, -1, "Zurzeit befinden sich keine Spieler auf dem Server die einen mute haben.");
- return 1;
- }
- CMD:prisoninfo(playerid, params[])
- {
- new string[128], count = 0;
- SendClientMessage(playerid, -1, "** "orange"Spieler im Prison "white"**");
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountJail] == 1)
- {
- format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountJailSec]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- count++;
- }
- }
- }
- if(count == 0) return SendClientMessage(playerid, -1, "Keine Spieler die zurzeit im Prison sind.");
- return 1;
- }
- //-------------------------------------------------------------------------------------------------------------------//
- CMD:akill(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- string[150],
- reason[128],
- id
- ;
- if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /akill [playerid] [reason(Default: None)]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- if(_God[id] == 1)
- {
- _God[id] = 0;
- }
- SetPlayerHealth(id, 0.0);
- format(string, sizeof(string), "** %s(%d) has been killed by Administrator %s(%d) (Reason: %s)", pName(id), id, pName(playerid), playerid, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- return 1;
- }
- CMD:prison(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new id, sec, reason[128], string[250];
- if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "/Prison [spielerid] [sekunden] [Grund]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht bei Admins ausführen die Rank höher sind als du.");
- if(sec < 900) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Du kannst nicht unter 900 sekunden jemanden ins Prison stecken.");
- if(User[id][accountJail] == 1) return SendClientMessage(playerid, COLOR_RED, "Spieler ist schon im Prison.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst ins Prison stecken.");
- SetCameraBehindPlayer(id);
- SetPlayerPos(id, 197.6661, 173.8179, 1003.0234);
- SetPlayerInterior(id, 3);
- format(string, sizeof(string), "** %s(%d) wurde von dem Administrator %s(%d) für %d Sekunden ins Prison gesteckt [%s]", pName(id), id, pName(playerid), playerid, sec, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- SendClientMessage(id, COLOR_ORANGE, "Du wurdest von den Administratoren ins Prison gesteckt, wenn du meinst der Admin hat eine fehlentscheidung getroffen dann mach bitte einen screenshot indem du (F8) drückst und melde dich im ts bei einem Admin.");
- #if LOG == true
- format(string, sizeof(string), "%s wurde ins Prison gesteckt von %s (%d sekunden, Grund %s)", pName(id), pName(playerid), sec, reason);
- SaveLog("jail.txt", string);
- #endif
- User[id][accountJail] = 1, User[id][accountJailSec] = sec;
- return 1;
- }
- CMD:unprison(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new id, reason[128], string[250];
- if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/unprison [spielerid] [Grund]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht online.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht bei Admins ausführen die Rank höher sind als du.");
- if(User[id][accountJail] == 0) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht im Prison.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selber rausholen.");
- format(string, sizeof(string), "** %s(%d) wurde aus dem Prison rausgeholt von %s(%d) für %s", pName(id), id, pName(playerid), playerid, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- SendClientMessage(id, COLOR_ORANGE, "Du wurdest aus dem Prison von den Admins rausgeholt.");
- #if LOG == true
- format(string, sizeof(string), "%s wurde aus dem Prison rausgeholt von %s für %s", pName(id), pName(playerid), reason);
- SaveLog("jail.txt", string);
- #endif
- User[id][accountJail] = 0, User[id][accountJailSec] = 0;
- SpawnPlayer(id);
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new id, sec, reason[128], string[128+50];
- if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /mute [playerid] [seconds] [reason]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- if(sec < 30) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot mute lower than 30 seconds.");
- if(User[id][accountMuted] == 1) return SendClientMessage(playerid,COLOR_RED, "Syntax Error: Player already muted.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
- format(string, sizeof(string), "** %s(%d) has been muted by Administrator %s(%d) for %d seconds [%s]", pName(id), id, pName(playerid), playerid, sec, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- SendClientMessage(id, COLOR_ORANGE, "You have been muted by an Admin, Press a screenshot (F8) and make a complaint on the forums, if you want to.");
- #if LOG == true
- format(string, sizeof(string), "%s has been muted by %s (%d seconds, reason %s)", pName(id), pName(playerid), sec, reason);
- SaveLog("mute.txt", string);
- #endif
- User[id][accountMuted] = 1, User[id][accountMuteSec] = sec;
- return 1;
- }
- CMD:unmute(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new id, reason[128], string[250];
- if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unmute [playerid] [reason]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- if(User[id][accountMuted] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not muted.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
- format(string, sizeof(string), "* %s(%d) has been unmuted by Administrator %s(%d) for %s", pName(id), id, pName(playerid), playerid, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- SendClientMessage(id, COLOR_ORANGE, "You have been unmuted by an Admin.");
- #if LOG == true
- format(string, sizeof(string), "%s has been unmuted by %s", pName(id), pName(playerid));
- SaveLog("mute.txt", string);
- #endif
- User[id][accountMuted] = 0, User[id][accountMuteSec] = 0;
- return 1;
- }
- CMD:clearchat(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- string[128]
- ;
- for(new i=0; i<100; i++)
- {
- SendClientMessageToAll(-1, " ");
- }
- format(string, sizeof string, "Administrator "orange"%s "white"has cleared the chat.", pName(playerid));
- SendClientMessageToAll(-1, string);
- return 1;
- }
- CMD:heal(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- id,
- string[130]
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /heal [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- SetPlayerHealth(id, 100.0);
- format(string, sizeof(string), "You have given Player %s a full pack of health.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s has given you a full pack of health.", pName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:awaffen(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- ammo,
- wID[32],
- weap,
- WeapName[32],
- string[130]
- ;
- if(sscanf(params, "s[32]i", wID, ammo)) return SendClientMessage(playerid, COLOR_RED, "/awaffen [Waffen ID)] [Munition]");
- if(ammo <= 0 || ammo > 99999) ammo = 500;
- if(!isnumeric(wID)) weap = GetWeaponIDFromName(wID);
- else weap = strval(wID);
- if(!IsValidWeapon(weap)) return SendClientMessage(playerid, COLOR_RED, "Ungültige Waffen ID");
- GetWeaponName(weap, WeapName, 32);
- foreach(new i : Player)
- {
- GivePlayerWeapon(i, weap, ammo);
- format(string, sizeof string, "~g~%s for all!", WeapName);
- GameTextForPlayer(i, string, 2500, 3);
- }
- format(string,sizeof(string), "Administrator %s(ID:%d) hat allen Spielern die Waffe %s(%d) mit %d Munition gegeben.", pName(playerid), playerid, WeapName, weap, ammo);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:armour(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- id,
- string[130]
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /armour [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- SetPlayerArmour(id, 100.0);
- format(string, sizeof(string), "You have given %s an armour.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s has given you a full armour.", pName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:respawncars(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- SendClientMessage(playerid, COLOR_GREEN, "Du hast alle Fahrzeuge erfolgreich respawnt!");
- GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Fahrzeuge ~g~Respawnt!", 3000, 3);
- for(new cars=0; cars<MAX_VEHICLES; cars++)
- {
- if(!VehicleOccupied(cars))
- {
- SetVehicleToRespawn(cars);
- }
- }
- return 1;
- }
- CMD:tp(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- id,
- string[130],
- Float:x,
- Float:y,
- Float:z
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/tp [spielerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht zu dir selber Teleportieren.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rang höher sind als du.");
- GetPlayerPos(playerid, x, y, z);
- SetPlayerInterior(id, GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
- if(GetPlayerState(id) == 2)
- {
- new VehicleID = GetPlayerVehicleID(id);
- SetVehiclePos(VehicleID, x+3, y, z);
- LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
- SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(playerid));
- }
- else SetPlayerPos(id, x+2, y, z);
- format(string, sizeof(string), "Du wurdest zum Standpunkt von dem Admin %s(ID:%d) teleportiert.", pName(playerid), playerid);
- SendClientMessage(id, COLOR_YELLOW, string);
- format(string, sizeof(string), "Du hast den Spieler %s(ID:%d) zu deinem Standpunkt teleportiert.", pName(id), id);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- CMD:tpspieler(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new
- string[128],
- id,
- id2,
- Float:x,
- Float:y,
- Float:z
- ;
- if(sscanf(params, "uu", id, id2)) return SendClientMessage(playerid, COLOR_RED, "/tpspieler [spielerid] zu [spielerid2]");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an einem Admin ausführen der Rank höher ist als du.");
- if(User[playerid][accountAdmin] < User[id2][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an einem Admin ausführen der Rank höher ist als du.");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(id2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(id == playerid && id2 == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht zu dir selbst Teleportieren!");
- GetPlayerPos(id2, x, y, z);
- format(string, sizeof(string), "Du hast den Spieler %s(%d) zu Player %s(%d) Teleportiert", pName(id), id, pName(id2), id2);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Du wurdest zu dem Spieler %s(%d) von dem Admin %s(%d) Teleportiert", pName(id2), id2, pName(playerid), playerid);
- SendClientMessage(id, COLOR_YELLOW, string);
- format(string, sizeof(string), "Admin %s(%d) hat den Spieler %s(%d) zu dir Teleportiert", pName(playerid), playerid, pName(id), id);
- SendClientMessage(id2, COLOR_YELLOW, string);
- SetPlayerInterior(id, GetPlayerInterior(id2));
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(id2));
- if(GetPlayerState(id) == 2)
- {
- SetVehiclePos(GetPlayerVehicleID(id), x+3, y, z);
- LinkVehicleToInterior(GetPlayerVehicleID(id), GetPlayerInterior(id2));
- SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(id2));
- }
- else SetPlayerPos(id, x+2, y, z);
- return 1;
- }
- //============================================================================//
- // Administrative Level Three //
- //============================================================================//
- CMD:warnentf(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130],
- id
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /remwarn [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot remove warn yourself.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- if(User[id][accountWarn] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player has no warnings.");
- User[id][accountWarn] -= 1;
- format(string, sizeof(string), "Administrator %s(%d) has removed %s(%d) warnings (Warnings Left: %i)", pName(playerid), playerid, pName(id), id, User[id][accountWarn]);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:warn(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[128],
- id,
- reason[128]
- ;
- if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /warn [playerid] [reason]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot warn yourself.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- User[id][accountWarn] += 1;
- format(string, sizeof(string), "Administrator %s(%d) warned %s(%d) for %s (Warnings: %d)", pName(playerid), playerid, pName(id), id, reason, User[id][accountWarn]);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:write(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- Colour,
- string[130]
- ;
- if(sscanf(params, "is[128]", Colour, params))
- return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /write [color] [text]") &&
- SendClientMessage(playerid, COLOR_GREY, "Colors: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
- if(Colour > 9) return SendClientMessage(playerid, COLOR_GREY, "Colors: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
- if(Colour == 0) { format(string,sizeof(string),"%s",params); SendClientMessageToAll(COLOR_BLACK,string);return 1;}
- else if(Colour == 1) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_WHITE,string); return 1;}
- else if(Colour == 2) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_RED,string); return 1;}
- else if(Colour == 3) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_ORANGE,string); return 1;}
- else if(Colour == 4) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_YELLOW,string); return 1;}
- else if(Colour == 5) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_GREEN,string); return 1;}
- else if(Colour == 6) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_BLUE,string); return 1;}
- else if(Colour == 7) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_PURPLE,string); return 1;}
- else if(Colour == 8) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_BROWN,string); return 1;}
- else if(Colour == 9) {
- format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_PINK,string); return 1;}
- return 1;
- }
- CMD:force(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130],
- id
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /force [playerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- format(string, sizeof(string), "You have force Player %s(ID:%d) to goto class selection.", pName(id), id);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Admin %s(ID:%d) force you to goto class selection.", pName(playerid), playerid);
- SendClientMessage(id, COLOR_YELLOW, string);
- SetPlayerHealth(id, 0.0);
- ForceClassSelection(id);
- return 1;
- }
- CMD:healall(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130]
- ;
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- SetPlayerHealth(i, 100.0);
- }
- }
- format(string, sizeof(string), "Admin %s(ID:%d) has heal all players.", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:setfstyle(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[128],
- id,
- fstyle,
- style[50]
- ;
- if(sscanf(params, "ui", id, fstyle)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setfstyle [playerid] [styles]") &&
- SendClientMessage(playerid, COLOR_GREY, "Styles: [0]Normal, [1]Boxing, [2]Kungfu, [3]Kneehead, [4]Grabkick, [5]Elbow");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- if(fstyle > 5) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Inavlid Fighting Style.");
- switch(fstyle)
- {
- case 0:
- {
- SetPlayerFightingStyle(id, 4);
- style = "Normal";
- }
- case 1:
- {
- SetPlayerFightingStyle(id, 5);
- style = "Boxing";
- }
- case 2:
- {
- SetPlayerFightingStyle(id, 6);
- style = "Kung Fu";
- }
- case 3:
- {
- SetPlayerFightingStyle(id, 7);
- style = "Kneehead";
- }
- case 4:
- {
- SetPlayerFightingStyle(id, 15);
- style = "Grabkick";
- }
- case 5:
- {
- SetPlayerFightingStyle(id, 16);
- style = "Elbow";
- }
- }
- format(string, sizeof(string), "You have set %s(ID:%d) fighting style to '%s'", pName(id), id, style);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Admin %s(ID:%d) has set your fighting style to '%s'", pName(playerid), playerid, style);
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130],
- id,
- hp
- ;
- if(sscanf(params, "ud", id, hp)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /sethealth [playerid] [heatlh]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- new Float:hp2 = float(hp);
- SetPlayerHealth(id, hp2);
- format(string, sizeof(string), "You have set Player %s(ID:%d) health to %d", pName(id), id, floatround(hp2));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Admin %s(ID:%d) has set your health to %d", pName(playerid), playerid, floatround(hp2));
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:gibarmour(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130],
- id,
- armour
- ;
- if(sscanf(params, "ud", id, armour)) return SendClientMessage(playerid, COLOR_RED, "/gibarmour [spielerid] [armour]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- new Float:ar = float(armour);
- SetPlayerArmour(id, ar);
- format(string, sizeof(string), "Du hast dem Spieler %s(ID:%d) eine Rüstung mit dem Wert %d deff gegeben", pName(id), id, floatround(ar));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s(ID:%d) Hat den Wert deiner Rüstung auf %d deff geändert", pName(playerid), playerid, floatround(ar));
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:allarmour(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130]
- ;
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- SetPlayerArmour(i, 100.0);
- }
- }
- format(string, sizeof(string), "Administrator %s(ID:%d) hat jedem Spieler eine Rüstung gegeben.", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:alltp(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 2);
- new Float:x,
- Float:y,
- Float:z,
- string[130],
- interior = GetPlayerInterior(playerid)
- ;
- GetPlayerPos(playerid, x, y, z);
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- SetPlayerPos(i, x+(playerid/4)+1, y+(playerid/4), z);
- SetPlayerInterior(i, interior);
- SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
- }
- }
- format(string, sizeof(string), "Administrator %s(ID:%d) hat alle Spieler zur seiner Position teleportier !", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[130],
- id,
- reason[128]
- ;
- if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/freeze [spielerid] [Grund]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst freezen.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rank höher sind als du.");
- TogglePlayerControllable(id, false);
- format(string, sizeof(string), "Du hast den Spieler %s(%d)gefreezt (Grund: %s)", pName(id), id, reason);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s(ID:%d) hat dich gefreezt (Grund: %s)", pName(playerid), playerid, reason);
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:gibwaffen(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- id,
- ammo,
- wID[32],
- weap,
- WeapName[32],
- string[130]
- ;
- if(sscanf(params, "us[32]i", id, wID, ammo)) return SendClientMessage(playerid, COLOR_RED, "/gibwaffen [spielerid] [Waffen Name] [Munition]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(ammo <= 0 || ammo > 99999) ammo = 500;
- if(!isnumeric(wID)) weap = GetWeaponIDFromName(wID);
- else weap = strval(wID);
- if(!IsValidWeapon(weap)) return SendClientMessage(playerid, COLOR_RED, "ungültiger Waffen Name.");
- GetWeaponName(weap, WeapName, 32);
- format(string, sizeof(string), "Du hast %s die Waffe %s(%d) mit %d Munition gegeben.", WeapName, weap, ammo, pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string,sizeof(string),"Administrator %s hat dir die Waffe %s(%d) mit %d Munition gegeben.", pName(playerid), WeapName, weap, ammo);
- SendClientMessage(id, COLOR_YELLOW, string);
- GivePlayerWeapon(id, weap, ammo);
- return 1;
- }
- CMD:unban(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[150],
- Account[24],
- DBResult:Result,
- Query[129],
- fIP[30]
- ;
- if(sscanf(params, "s[24]", Account)) return SendClientMessage(playerid, COLOR_RED, "/unban [Account Name]");
- format(Query, 129, "SELECT * FROM `bans` WHERE `username` = '%s'", Account);
- Result = db_query(Database, Query);
- if(db_num_rows(Result))
- {
- db_get_field_assoc(Result, "ip", fIP, 30);
- format(Query, 129, "DELETE FROM `bans` WHERE `username` = '%s'", Account);
- Result = db_query(Database, Query);
- db_free_result(Result);
- format(string, sizeof string, "Administrator %s hat den Spieler %s gebannt.", pName(playerid), Account);
- SendClientMessageToAll(COLOR_YELLOW, string);
- print(string);
- #if LOG == true
- SaveLog("banlog.txt", string);
- #endif
- }
- else
- {
- db_free_result(Result);
- SendClientMessage(playerid, COLOR_RED, "Spieler nicht in der Datenbank(Bannliste) gefunden.");
- return 1;
- }
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[128],
- id,
- reason[128],
- when[128],
- ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
- ;
- gettime(ban_hr, ban_min, ban_sec);
- getdate(ban_years, ban_month, ban_days);
- if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /ban [spielerid] [Grund(Standartt: No Reason)]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selber bannen.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rang höher sind als du.");
- format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
- format(string, sizeof(string), "** %s(ID:%d) wurde von dem Administrator %s(%d)gebannt (Grund: %s)", pName(id), id, pName(playerid), playerid, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- printf(string);
- #if LOG == true
- SaveLog("banlog.txt", string);
- #endif
- format(string, sizeof(string), "You have banned %s(%d) for %s.", pName(id), id, reason);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Du wurdest von dem Administrator %s(%d) gebannt (Grund: %s)", pName(playerid), playerid, reason);
- SendClientMessage(id, COLOR_YELLOW, string);
- BanAccount(id, pName(playerid), reason);
- ShowBan(id, pName(playerid), reason, when);
- KickDelay(id);
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 3);
- new
- string[128],
- id
- ;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/unfreeze [spielerid]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rank höher sind als du.");
- TogglePlayerControllable(id, true);
- format(string, sizeof(string), "Du hast den Spieler %s(%d) unfreezt", pName(id), id);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s(%d) hat dich unfreezt du kannst dich wieder normal Bewegen.", pName(playerid), playerid);
- SendClientMessage(id, COLOR_YELLOW, string);
- return 1;
- }
- CMD:offlineban(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- string[150],
- name[24],
- reason[128],
- Query[256],
- admin,
- ip[20],
- DBResult:Result,
- ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
- ;
- gettime(ban_hr, ban_min, ban_sec);
- getdate(ban_years, ban_month, ban_days);
- if(sscanf(params, "s[24]s[128]", name, reason)) return SendClientMessage(playerid, COLOR_RED, "/offlineban [Name] [Grund]");
- foreach(new i : Player)
- {
- if(strcmp(pName(i), name, true) == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "Der Spieler den du Offlinebannen wolltest ist Online, benutze statdessen /ban.");
- return 1;
- }
- }
- format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", DB_Escape(name));
- Result = db_query(Database, Query);
- if(db_num_rows(Result))
- {
- db_get_field_assoc(Result, "admin", Query, 6);
- admin = strval(Query);
- db_get_field_assoc(Result, "IP", ip, 20);
- if(User[playerid][accountAdmin] < admin)
- {
- SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rank höher sind als du.");
- #if LOG == true
- format(string, sizeof(string), "%s hat versucht den Spieler offline zu bannen %s aber fehlgeschlagen für %s", pName(playerid), name, reason);
- SaveLog("admin.txt", string);
- #endif
- return 1;
- }
- BanAccountEx(name, ip, pName(playerid), reason);
- format(string, sizeof(string), "** %s wurde von dem Administrator %s(%d)Offline gebannt (Grund: %s)", name, pName(playerid), playerid, reason);
- SendClientMessageToAll(COLOR_GREY, string);
- printf(string);
- #if LOG == true
- SaveLog("banlog.txt", string);
- #endif
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Es gibt keinen Spieler mit diesen Daten in der Datenbank.");
- }
- db_free_result(Result);
- return 1;
- }
- //============================================================================//
- // Administrative Level Four //
- //============================================================================//
- CMD:setinterior(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- string[130],
- id,
- interior
- ;
- if(sscanf(params, "ui", id, interior)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setinterior [playerid] [interior]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
- if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
- SetPlayerInterior(id, interior);
- format(string, sizeof(string), "Administrator %s has set your interior to %d.", pName(playerid), interior);
- SendClientMessage(id, COLOR_ORANGE, string);
- format(string, sizeof(string), "You have set Player %s's interior to %d.", pName(id), interior);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- return 1;
- }
- CMD:restart(playerid, params[])
- {
- new
- time
- ;
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- if(sscanf(params, "I(0)", time)) return SendClientMessage(playerid, COLOR_RED, "/restart [Restart Timer(optional)") &&
- SendClientMessage(playerid, -1, "Tipp: Trage als Timer nichts ein für einen schnellen Restart");
- if(time < 10 && time !=0) return SendClientMessage(playerid, COLOR_RED, "Der Restart kann nicht unter 10min dauern.");
- return 1;
- }
- CMD:setallinterior(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- id,
- string[130]
- ;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setallinterior [interior]");
- foreach(new i : Player)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- SetPlayerInterior(i, id);
- }
- format(string, sizeof(string), "Admin %s(ID:%d) has set all players interior to \"%d\"", pName(playerid), playerid, id);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:aexplode(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- string[130],
- Float:x,
- Float:y,
- Float:z
- ;
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- GetPlayerPos(i, x, y, z);
- CreateExplosion(x, y, z, 7, 1.00);
- }
- }
- format(string, sizeof(string), "Administrator %s(ID:%d) hat alle Spieler zum explodieren gebracht :D.", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- printf(string);
- return 1;
- }
- CMD:akick(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- string[130]
- ;
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- KickDelay(i);
- }
- }
- format(string, sizeof(string), "Administrator %s(ID:%d) hat alle Spieler gekickt.", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- printf(string);
- #if LOG == true
- SaveLog("kicklog.txt", string);
- #endif
- return 1;
- }
- CMD:awaffenentf(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- string[128]
- ;
- foreach(new i : Player)
- {
- ResetPlayerWeapons(i);
- }
- format(string, sizeof(string), "Administrator %s(ID:%d) hat die Waffen aller Spieler entfernt.", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:alevel(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- id,
- string[130]
- ;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/alllevel [level]");
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- SetPlayerScore(i, GetPlayerScore(i) + id);
- }
- }
- format(string, sizeof(string), "Administrator %s(ID:%d) hat allen Spielern Level \"%d\ gegeben"", pName(playerid), playerid, id);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:settime(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- id,
- string[128]
- ;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/settime [time(0-23)]");
- if(id < 0 || id > 23) return SendClientMessage(playerid, COLOR_RED, "Ungueltige Uhrzeit (0-23).");
- foreach(new i : Player)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- SetPlayerTime(i, id, 0);
- }
- format(string, sizeof(string), "Admin %s(ID:%d) has set all players time to \"%d:00\"", pName(playerid), playerid, id);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:ageld(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- id,
- string[130]
- ;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/ageld [geld]");
- foreach(new i : Player)
- {
- if(i != playerid)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- GivePlayerMoney(i, id);
- }
- }
- format(string, sizeof(string), "Admin %s(ID:%d) hat allen Spielern \"$%d\ gegeben"", pName(playerid), playerid, id);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- CMD:setweather(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 4);
- new
- id,
- string[128]
- ;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/setweather [weather(0-45)]");
- if(id < 0 || id > 45) return SendClientMessage(playerid, COLOR_RED, "Ungültige Wetter ID! (0-45)");
- foreach(new i : Player)
- {
- PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
- SetPlayerWeather(i, id);
- }
- format(string, sizeof(string), "Das Wetter wurde geändert \"%d\"", pName(playerid), playerid, id);
- SendClientMessageToAll(COLOR_YELLOW, string);
- return 1;
- }
- //============================================================================//
- // Administrative Level Five //
- //============================================================================//
- CMD:explode(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new string[128],
- id,
- Float:x,
- Float:y,
- Float:z,
- reason[128]
- ;
- if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/explode [spielerid] [Grund(Standart: N/A)]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- GetPlayerPos(id, x, y, z);
- format(string, sizeof(string), "** %s(%d) wurde von dem Administrator explodiert %s [Grund: %s]", pName(id), id, pName(playerid), reason);
- SendClientMessageToAll(COLOR_GREY, string);
- #if LOG == true
- SaveLog("explode.txt", string);
- #endif
- CreateExplosion(x, y, z, 7, 1.00);
- return 1;
- }
- CMD:setgeld(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- id,
- string[128],
- amount
- ;
- if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "/setgeld [spielerid] [cash]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- ResetPlayerMoney(id);
- GivePlayerMoney(id, amount);
- format(string, sizeof(string), "Du hast den Geldbetrag von %s's zu $%i gemacht.", pName(id), amount);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s hat dein Geldbetrag zu $%i gemacht.", pName(playerid), amount);
- SendClientMessage(id, COLOR_YELLOW, string);
- #if LOG == true
- format(string, sizeof string, "Administrator %s hat den Geldbetrag von %s's zu $%i gemacht", pName(playerid), pName(id), amount);
- SaveLog("set.txt", string);
- #endif
- return 1;
- }
- CMD:setlevel(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- id,
- string[128],
- amount
- ;
- if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "/setlevel [spielerid] [level]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- SetPlayerScore(id, amount);
- format(string, sizeof(string), "Du hast das Level %s's zu %i geändert.", pName(id), amount);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s hat dein Level zu %i geändert.", pName(playerid), amount);
- SendClientMessage(id, COLOR_YELLOW, string);
- #if LOG == true
- format(string, sizeof string, "Administrator %s hat das Level von %s's zu %i gemacht", pName(playerid), pName(id), amount);
- SaveLog("set.txt", string);
- #endif
- return 1;
- }
- CMD:jetpack(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- id,
- string[130]
- ;
- if(!sscanf(params, "u", id))
- {
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- SetPlayerSpecialAction(id, SPECIAL_ACTION_USEJETPACK);
- format(string, sizeof(string), "Du hast dem Spieler %s(ID:%d) ein Jetpack gegeben.", pName(id), id);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Administrator %s(ID:%d) hat dir ein Jetpack gegeben.", pName(playerid), playerid);
- SendClientMessage(id, COLOR_YELLOW, string);
- }
- else
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
- SendClientMessage(playerid, COLOR_YELLOW, "Jetpack Spawned!");
- SendClientMessage(playerid, -1, "Du willst anderen Spieler ein Jetpack geben? Dann benutze "orange"/jetpack [playerid]");
- }
- return 1;
- }
- CMD:acctot(playerid, params[])
- {
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- new
- Account[MAX_PLAYER_NAME],
- Reason[100],
- string[128]
- ;
- if(sscanf(params, "s[24]s[100]", Account, Reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /acctot [Account Name] [Grund]");
- if(DataExist(Account))
- {
- if(!strcmp(pName(playerid), Account, false))
- return SendClientMessage(playerid, COLOR_RED, "Du kannst nicht dein Acc selber löschen!");
- foreach(new i : Player)
- {
- if(strcmp(Account, pName(i), true) == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is online, fail to delete the account.");
- return 1;
- }
- }
- new Query[128+50];
- format(Query, 100, "DELETE FROM `users` WHERE `username` = '%s'", Account);
- db_query(Database, Query);
- db_free_result(db_query(Database, Query));
- format(string, 128, "Admin %s(ID: %d) hat den Account %s's getötet [Grund: %s]", pName(playerid), playerid, Account, Reason);
- SendClientMessageToAll(COLOR_YELLOW, string);
- SaveLog("account.txt", string);
- format(string, 128, "Du hast den Account %s's erfolgreich getötet [Grund: %s]", Account, Reason);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Account wurde in der Datenbank nicht gefunden!");
- }
- return 1;
- }
- CMD:adminrank(playerid, params[])
- {
- new
- string[128],
- id,
- level
- ;
- LoginCheck(playerid);
- LevelCheck(playerid, 5);
- if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_RED, "/adminrank [spielerid] [level(0/4)]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
- if(level < 0 || level > 4) return SendClientMessage(playerid, COLOR_RED, "Der adminrank darf nicht unter null und über 4 sein.");
- if(level == User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Spieler ist schon in diesem Adminrank.");
- if(User[id][accountLogged] == false) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not logged in.");
- if(User[id][accountAdmin] < level)
- {
- format(string, 128, "Du wurdest zum Adminrank %d befördert von [%s].", level, pName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- format(string, 128, "Du hast %s zum Adminrank %d befördert.", pName(id), level);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- else if(User[id][accountAdmin] > level)
- {
- format(string, 128, "Du wurdest zum Adminrank %d degradiert von [%s].", level, pName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- format(string, 128, "Du hast %s zum Adminrank %d degradiert.", pName(id), level);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- User[id][accountAdmin] = level;
- #if LOG == true
- format(string, sizeof string, "Administrator %s hat %s's adminrank zum %d gemacht", pName(playerid), pName(id), level);
- SaveLog("account.txt", string);
- #endif
- SaveData(id); //Saving the whole data - Neater version than previously.
- return 1;
- }
- //============================================================================//
- // Administrative Level Zero //
- //============================================================================//
- CMD:admins(playerid, params[])
- {
- new string[128], count = 0;
- SendClientMessage(playerid, -1, "** "orange"Admins Online "white"**");
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountAdmin] >= 1)
- {
- format(string, sizeof(string), "(%d) %s - Level %d Admin", i, pName(i), User[i][accountAdmin]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- count++;
- }
- }
- }
- if(count == 0) return SendClientMessage(playerid, -1, "Kein Administrator Online.");
- return 1;
- }
- CMD:report(playerid, params[])
- {
- new id, reason[128], string[136];
- if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/report [spielerid] [Grund]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst Reporten.");
- new r_hr, r_min, r_sec, r_m, r_d, r_y;
- getdate(r_y, r_m, r_d);
- gettime(r_hr, r_min, r_sec);
- reportmsg[3] = reportmsg[2];
- reportmsg[2] = reportmsg[1];
- reportmsg[1] = reportmsg[0];
- format(string, sizeof(string), "(%02d/%02d/%d - %02d:%02d:%02d) %s(ID:%d) hat %s(ID:%d)reportet für %s", r_m, r_d, r_y, r_hr, r_min, r_sec, pName(playerid), playerid, pName(id), id, reason);
- reportmsg[0] = string;
- format(string, sizeof(string), "REPORT: %s(ID:%d) hat %s(ID:%d) reportet für %s", pName(playerid), playerid, pName(id), id, reason);
- SendAdmin(COLOR_RED, string);
- foreach(new i : Player)
- {
- if(User[i][accountLogged] == true)
- {
- if(User[i][accountAdmin] >= 1)
- {
- PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
- #if ReportTD == true
- TextDrawShowForPlayer(i, Textdraw0);
- SetTimerEx("HideTD", 3500, false, "d", i);
- #endif
- }
- }
- }
- format(string, sizeof(string), "Deine Beschwerde gegen %s(ID:%d) %s wurde an die Admins die Online sind gesendet.", pName(id), id, reason);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- #if ReportTD == true
- function:HideTD(playerid)
- {
- return TextDrawHideForPlayer(playerid, Textdraw0);
- }
- #endif
- CMD:register(playerid, params[])
- {
- if(User[playerid][accountLogged] == true) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are logged in and registered already.");
- if(!DataExist(pName(playerid)))
- {
- new
- string[128],
- password[24],
- hashpass[129]
- ;
- if(sscanf(params, "s[24]", password)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /register [password]");
- if(!IsValidPassword(password)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Password Symbols.");
- if(strlen(password) < 4 || strlen(password) > 20) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Password length shouldn't go below 4 and shouldn't go higher 20.");
- WP_Hash(hashpass, 129, password);
- SetPlayerScore(playerid, STARTING_SCORE);
- GivePlayerMoney(playerid, STARTING_CASH);
- //Time = Hours, Time2 = Minutes, Time3 = Seconds
- new time, time2, time3;
- gettime(time, time2, time3);
- new date, date2, date3;
- //Date = Month, Date2 = Day, Date3 = Year
- getdate(date3, date, date2);
- format(User[playerid][accountDate], 150, "%02d/%02d/%d %02d:%02d:%02d", date, date2, date3, time, time2, time3);
- new
- query[750+1000]
- ;
- format(query, sizeof(query),
- "INSERT INTO `users` (`username`, `IP`, `joindate`, `password`, `admin`, `kills`, `deaths`, `score`, `money`, `warn`, `mute`, `jail`, `jailsec`, `hours`, `minutes`, `seconds`) VALUES ('%s','%s','%s','%s',0,0,0,%d,%d,0,0,0,0,0,0,0,0,0,0,'%s','%s')",\
- DB_Escape(pName(playerid)),
- DB_Escape(User[playerid][accountIP]),
- DB_Escape(User[playerid][accountDate]),
- DB_Escape(hashpass),
- User[playerid][accountScore],
- User[playerid][accountCash],
- DB_Escape(User[playerid][accountQuestion]),
- DB_Escape(User[playerid][accountAnswer])
- );
- db_query(Database, query);
- User[playerid][accountLogged] = true;
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- new
- count,
- DBResult: result
- ;
- result = db_query(Database, "SELECT * FROM `users`");
- count = db_num_rows(result);
- db_free_result(result);
- User[playerid][accountID] = count;
- SendClientMessage(playerid, -1, "You have successfully registered from the database.");
- format(string, sizeof(string), "You are now handling accountID %i from the JakAdmin3 system.", count);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- SendClientMessage(playerid, COLOR_YELLOW, "Proceeding to the Security Question.");
- SD(playerid, DIALOG_QUESTION, DI, ""lightblue"Security Question", ""grey"Welcome to JakAdmin3's security question, Where you'll setup your account's security question.\nYou can use the Security Question incase you forgot your password, you can rely on it 100 percent.\n\nPut your question below:", "Setup", "");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Syntax Error: You already have an account, /login instead.");
- }
- return 1;
- }
- CMD:login(playerid, params[])
- {
- if(User[playerid][accountLogged] == true) return SendClientMessage(playerid, COLOR_RED, "Du hast dich erfolgreich eingeloggt.");
- if(DataExist(pName(playerid)))
- {
- new
- hashp[129],
- string[900],
- password[24]
- ;
- if(sscanf(params, "s[24]", password)) return SendClientMessage(playerid, COLOR_RED, "/login [password]");
- if(strcmp(password, "forget", true) == 0)
- {
- format(string, sizeof(string), ""grey"You have forgotten your password? If that's the case, answer the question you set on your account and you'll access your account.\n\n%s\n\nAnswer?\nPress Quit if you are willing to quit.", User[playerid][accountQuestion]);
- SD(playerid, DIALOG_FORGET, DI, ""lightblue"Security Question", string, "Answer", "Quit");
- return 1;
- }
- WP_Hash(hashp, 129, password);
- if(!strcmp(hashp, User[playerid][accountPassword], false))
- {
- LoginPlayer(playerid);
- }
- else
- {
- User[playerid][WarnLog]++;
- if(User[playerid][WarnLog] == 3)
- {
- SD(playerid, DIALOG_BEGIN, DM, ""lightblue"Kicked", ""grey"Du wurdest gekickt, weil du zu oft das falsche Password eingegeben hast!\nVersuch es nochmal, Reconnect (/q dann join den Server nochmal.)", "Verlassen", "");
- KickDelay(playerid);
- return 1;
- }
- format(string, sizeof(string), "Invalid password! - %d out of 3 Warning Log Tires.", User[playerid][WarnLog]);
- SendClientMessage(playerid, COLOR_RED, string);
- SendClientMessage(playerid, -1, "LOGIN: Versuche es nochmal, /login [password].");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Du hast noch keinen Account, dann benutze /register ");
- }
- return 1;
- }
- CMD:stats(playerid, params[])
- {
- LoginCheck(playerid);
- new id;
- if(sscanf(params, "u")) return SendClientMessage(playerid, COLOR_RED, "/stats ");
- ShowStatistics(playerid, id); //Show the statistics to yourself.
- return 1;
- }
- // //
- //============================================================================//
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- foreach(new x : Player)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid && User[x][SpecType] == ADMIN_SPEC_TYPE_VEHICLE)
- {
- TogglePlayerSpectating(x, 1);
- PlayerSpectatePlayer(x, playerid);
- User[x][SpecType] = ADMIN_SPEC_TYPE_PLAYER;
- }
- }
- }
- if(newstate == PLAYER_STATE_PASSENGER)
- {
- foreach(new x : Player)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
- {
- TogglePlayerSpectating(x, 1);
- PlayerSpectateVehicle(x, vehicleid);
- User[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
- }
- }
- }
- if(newstate == PLAYER_STATE_DRIVER)
- {
- foreach(new x : Player)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
- {
- TogglePlayerSpectating(x, 1);
- PlayerSpectateVehicle(x, vehicleid);
- User[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
- }
- }
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- #if ANTI_SPAWN == true
- if(User[playerid][accountLogged] == false)
- {
- SendClientMessage(playerid, COLOR_RED, "Du musst dich Einloggen oder Registrieren bevor du Spawnen kannst.");
- return 0;
- }
- #endif
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- foreach(new x : Player)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid && User[x][SpecType] == ADMIN_SPEC_TYPE_PLAYER)
- {
- SetPlayerInterior(x,newinteriorid);
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
- {
- if(newkeys == KEY_JUMP) AdvanceSpectate(playerid);
- else if(newkeys == KEY_SPRINT) ReverseSpectate(playerid);
- }
- return 1;
- }
- #if RconProtect == true
- public OnPlayerRconLogin(playerid)
- {
- if(_RCON[playerid] == false)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Der Server hat einen zweiten RCON, geschützt von Lolbob");
- SD(playerid, DIALOG_RCON, DP, ""green"zweite RCON password", ""grey"Das zweite RCON password ist geschützt von Lolbob\nBitte scheibe den zweiten password um dir Zugang zum RCON zu verschaffen.", "Access", "Kick");
- }
- return 1;
- }
- #endif
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- #if RconProtect == true
- case DIALOG_RCON:
- {
- new
- string[130]
- ;
- if(!response)
- {
- format(string, sizeof(string), "** Spieler %s(ID:%d) wurde vom Server gekickt (zu viele Versuche um Zugang zu RCON zu verschaffen)", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_GREY, string);
- print(string);
- #if LOG == true
- SaveLog("rcon.txt", string);
- #endif
- return KickDelay(playerid);
- }
- if(response)
- {
- if(!strcmp(RconPass, inputtext) && !(!strlen(inputtext)))
- {
- format(string, sizeof(string), "** Spieler %s(ID:%d) hat sich erfolgreich Zugang zum RCON verschafft!", pName(playerid), playerid);
- SendAdmin(COLOR_GREY, string);
- print(string);
- #if LOG == true
- SaveLog("rcon.txt", string);
- #endif
- _RCON[playerid] = true;
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~Autorisierter ~w~Zugang!~n~~y~Willkommen Administrator!", 3000, 3);
- }
- else
- {
- if(_RCONwarn[playerid] == MAX_RCON_WARNINGS+1)
- {
- format(string, sizeof(string), "** Spieler %s(ID:%d) wurde vom Server gekickt (zu viele Versuche um Zugang zu RCON zu verschaffen)", pName(playerid), playerid);
- SendClientMessageToAll(COLOR_GREY, string);
- print(string);
- #if LOG == true
- SaveLog("kicklog.txt", string);
- #endif
- KickDelay(playerid);
- return 1;
- }
- _RCONwarn[playerid] ++;
- format(string, sizeof(string), "You have been warned for incorrect 2nd RCON Password (Warnings: %i/%i)", _RCONwarn[playerid], MAX_RCON_WARNINGS);
- SendClientMessage(playerid, COLOR_GREY, string);
- SD(playerid, DIALOG_RCON, DP, ""green"2nd RCON Password", ""grey"The RCON password is protected by JakAdmin3\nPlease type the 2nd RCON Password to access the RCON.", "Access", "Kick");
- }
- }
- }
- #endif
- case DIALOG_REGISTER:
- {
- new
- string[128],
- hashpass[129]
- ;
- if(response)
- {
- if(!IsValidPassword(inputtext))
- {
- SD(playerid, DIALOG_REGISTER, DP, ""lightblue"JakAdmin3 - Register", ""grey"Welcome to the Server!\nYour account doesn't exist on our database, Please insert your password below.\n\nTIPS: Make the password long so no one can hack it.\nERROR: Invalid Password Symbols.", "Register", "Quit");
- return 0;
- }
- if (strlen(inputtext) < 4 || strlen(inputtext) > 20)
- {
- SD(playerid, DIALOG_REGISTER, DP, ""lightblue"JakAdmin3 - Register", ""grey"Welcome to the Server!\nYour account doesn't exist on our database, Please insert your password below.\n\nTIPS: Make the password long so no one can hack it.\nERROR: Password length shouldn't go below 4 and shouldn't go higher 20.", "Register", "Quit");
- return 0;
- }
- WP_Hash(hashpass, 129, inputtext);
- SetPlayerScore(playerid, STARTING_SCORE);
- GivePlayerMoney(playerid, STARTING_CASH);
- //Time = Hours, Time2 = Minutes, Time3 = Seconds
- new time, time2, time3;
- gettime(time, time2, time3);
- new date, date2, date3;
- //Date = Month, Date2 = Day, Date3 = Year
- getdate(date3, date, date2);
- format(User[playerid][accountDate], 150, "%02d/%02d/%d %02d:%02d:%02d", date, date2, date3, time, time2, time3);
- format(User[playerid][accountQuestion], 129, "What?");
- format(User[playerid][accountAnswer], 129, "Yes");
- new
- query[750+1000]
- ;
- format(query, sizeof(query),
- "INSERT INTO `users` (`username`, `IP`, `joindate`, `password`, `admin`, `kills`, `deaths`, `score`, `money`, `warn`, `mute`, `mutesec`, `cmute`, `cmutesec`, `jail`, `jailsec`, `hours`, `minutes`, `seconds`, `question`, `answer`) VALUES ('%s','%s','%s','%s',0,0,0,%d,%d,0,0,0,0,0,0,0,0,0,0,'%s','%s')",\
- DB_Escape(pName(playerid)),
- DB_Escape(User[playerid][accountIP]),
- DB_Escape(User[playerid][accountDate]),
- DB_Escape(hashpass),
- User[playerid][accountScore],
- User[playerid][accountCash],
- DB_Escape(User[playerid][accountQuestion]),
- DB_Escape(User[playerid][accountAnswer])
- );
- db_query(Database, query);
- User[playerid][accountLogged] = true;
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- new
- count,
- DBResult: result
- ;
- result = db_query(Database, "SELECT * FROM `users`");
- count = db_num_rows(result);
- db_free_result(result);
- User[playerid][accountID] = count;
- SendClientMessage(playerid, -1, "You have successfully registered from the database.");
- format(string, sizeof(string), "You are now handling accountID %i from the JakAdmin3 system.", count);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- }
- }
- case DIALOG_LOGIN:
- {
- new
- hashp[129],
- string[900]
- ;
- if(response)
- {
- WP_Hash(hashp, 129, inputtext);
- if(!strcmp(hashp, User[playerid][accountPassword], false))
- {
- LoginPlayer(playerid);
- }
- else
- {
- User[playerid][WarnLog]++;
- if(User[playerid][WarnLog] == 3)
- {
- SD(playerid, DIALOG_BEGIN, DM, ""lightblue"Kicked", ""grey"You have been kicked from the server having too much wrong passwords!\nTry again, Reconnect (/q then join to the server again.)", "Close", "");
- KickDelay(playerid);
- return 0;
- }
- format(string, sizeof(string), "Invalid password! - %d out of 3 Warning Log Tires.", User[playerid][WarnLog]);
- SendClientMessage(playerid, COLOR_RED, string);
- format(string, sizeof(string), ""grey"Welcome back to the server!\nYour account exists on our database, Please insert your account's password below.\n\nTIPS: If you do not own the account, Please /q and find another username.\nERROR: Wrong password (%d/3 Warnings Log)", User[playerid][WarnLog]);
- }
- }
- }
- case DIALOG_COLORS:
- {
- new string[120], id = GetPVarInt(playerid, "_Colors_");
- switch( response )
- {
- case 0:
- {
- DeletePVar(playerid, "_Colors_");
- SendClientMessage(playerid, -1, "Colour setting has been cancelled.");
- }
- case 1:
- {
- switch( listitem )
- {
- case 0:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "black"Black", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_BLACK);
- DeletePVar(playerid, "_Colors_");
- }
- case 1:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "white"White", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_WHITE);
- DeletePVar(playerid, "_Colors_");
- }
- case 2:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "red"Red", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_RED);
- DeletePVar(playerid, "_Colors_");
- }
- case 3:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "orange"Orange", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_ORANGE);
- DeletePVar(playerid, "_Colors_");
- }
- case 4:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "yellow"Yellow", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_YELLOW);
- DeletePVar(playerid, "_Colors_");
- }
- case 5:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "green"Green", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_GREEN);
- DeletePVar(playerid, "_Colors_");
- }
- case 6:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "blue"Blue", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_BLUE);
- DeletePVar(playerid, "_Colors_");
- }
- case 7:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "purple"Purple", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_PURPLE);
- DeletePVar(playerid, "_Colors_");
- }
- case 8:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "brown"Brown", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_BROWN);
- DeletePVar(playerid, "_Colors_");
- }
- case 9:
- {
- format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "pink"Pink", pName(playerid));
- SendClientMessage(id, -1, string);
- format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerColor(id, COLOR_PINK);
- DeletePVar(playerid, "_Colors_");
- }
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- new string[128+50];
- format(string, sizeof(string), "You are now viewing '{%06x}%s"white"' statistics.", GetPlayerColor(clickedplayerid) >>> 8, pName(clickedplayerid));
- SendClientMessage(playerid, -1, string);
- ShowStatistics(playerid, clickedplayerid);
- return 1;
- }
- //============================================================================//
- //Stock and functions starts here.
- stock pName(playerid)
- {
- new GetName[24];
- GetPlayerName(playerid, GetName, 24);
- return GetName;
- }
- function:ShowStatistics(playerid, playerid2)
- {
- if(playerid2 == INVALID_PLAYER_ID) return 1; //Do not proceed.
- new string[1024], string2[64];
- format(string, sizeof(string), ""grey"Spieler ID: %d\n", playerid2);
- format(string, sizeof(string), "%sMitglied seit: %s\n", string, User[playerid2][accountDate]);
- format(string, sizeof(string), "%sOnline Zeit: %02d:%02d:%02d\n", string, User[playerid2][accountGame][2], User[playerid2][accountGame][1], User[playerid2][accountGame][0]);
- format(string, sizeof(string), "%sAdmin Rang: %d\n", string, User[playerid2][accountAdmin]);
- format(string, sizeof(string), "%sLevel: %d\n", string, User[playerid2][accountScore]);
- format(string, sizeof(string), "%sGeld: $%d\n", string, User[playerid2][accountCash]);
- format(string, sizeof(string), "%sKills: %d\n", string, User[playerid2][accountKills]);
- format(string, sizeof(string), "%sMorde: %d\n", string, User[playerid2][accountDeaths]);
- new deaths = User[playerid2][accountDeaths];
- if(deaths == 0) deaths = 1; //Man kann nicht durch 0 teilen.
- new Float:ratio = (float(User[playerid2][accountKills])/float(deaths));
- format(string, sizeof(string), "%sRatio (K/D): %.3f\n", string, ratio);
- format(string2, sizeof(string2), "{FFA200}%s's Statistiken", pName(playerid2));
- SD(playerid, DIALOG_BEGIN, DM, string2, string, "Verlassen", "");
- return 1;
- }
- function:KickMe(playerid)
- {
- return Kick(playerid);
- }
- stock KickDelay(playerid)
- {
- SetTimerEx("KickMe", 2000, false, "d", playerid);
- return 1;
- }
- stock loadb()
- {
- Database = db_open(_DB_);
- db_query(Database,
- "CREATE TABLE IF NOT EXISTS `users`\
- (`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT)");
- db_query(Database,
- "CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
- print("[JakAdmin3] "_DB_" loading...");
- return 1;
- }
- stock closedb()
- {
- print("[JakAdmin3] "_DB_" closing...");
- return db_close(Database);
- }
- stock SaveData(playerid)
- {
- new
- Query[700+1000]
- ;
- format(Query, sizeof(Query), "UPDATE `users` SET `IP` = '%s', `admin` = %d, `kills` = %d, `deaths` = %d, `score` = %d, `money` = %d, `warn` = %d, `mute` = %d, `mutesec` = %d, `cmute` = %d, `cmutesec` = %d, `jail` = %d, `jailsec` = %d, `hours` = %d, `minutes` = %d, `seconds` = %d, `question` = '%s', `answer` = '%s' WHERE `username` = '%s'",
- DB_Escape(User[playerid][accountIP]),
- User[playerid][accountAdmin],
- User[playerid][accountKills],
- User[playerid][accountDeaths],
- User[playerid][accountScore],
- User[playerid][accountCash],
- User[playerid][accountWarn],
- User[playerid][accountMuted],
- User[playerid][accountMuteSec],
- User[playerid][accountCMuted],
- User[playerid][accountCMuteSec],
- User[playerid][accountJail],
- User[playerid][accountJailSec],
- User[playerid][accountGame][2],
- User[playerid][accountGame][1],
- User[playerid][accountGame][0],
- DB_Escape(User[playerid][accountQuestion]),
- DB_Escape(User[playerid][accountAnswer]),
- DB_Escape(User[playerid][accountName])
- );
- db_query(Database, Query);
- db_free_result(db_query(Database, Query));
- return 1;
- }
- stock getIP(playerid)
- {
- new twerp[20];
- GetPlayerIp(playerid, twerp, 20);
- return twerp;
- }
- 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;
- }
- stock GetWeaponIDFromName(WeaponName[])
- {
- if(strfind("molotov", WeaponName, true) != -1) return 18;
- for(new i = 0; i <= 46; i++)
- {
- switch(i)
- {
- case 0,19,20,21,44,45: continue;
- default:
- {
- new name[32]; GetWeaponName(i,name,32);
- if(strfind(name,WeaponName,true) != -1) return i;
- }
- }
- }
- return -1;
- }
- function:LoginPlayer(playerid)
- {
- new
- Query[900],
- DBResult:Result,
- string[128+40]
- ;
- format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", DB_Escape(pName(playerid)));
- Result = db_query(Database, Query);
- if(db_num_rows(Result))
- {
- db_get_field_assoc(Result, "userid", Query, 7);
- User[playerid][accountID] = strval(Query);
- db_get_field_assoc(Result, "score", Query, 20);
- User[playerid][accountScore] = strval(Query);
- SetPlayerScore(playerid, User[playerid][accountScore]);
- db_get_field_assoc(Result, "money", Query, 20);
- User[playerid][accountCash] = strval(Query);
- GivePlayerMoney(playerid, User[playerid][accountCash]);
- db_get_field_assoc(Result, "kills", Query, 20);
- User[playerid][accountKills] = strval(Query);
- db_get_field_assoc(Result, "deaths", Query, 20);
- User[playerid][accountDeaths] = strval(Query);
- db_get_field_assoc(Result, "admin", Query, 7);
- User[playerid][accountAdmin] = strval(Query);
- db_get_field_assoc(Result, "joindate", Query, 150);
- format(User[playerid][accountDate], 150, "%s", Query);
- db_get_field_assoc(Result, "warn", Query, 5);
- User[playerid][accountWarn] = strval(Query);
- db_get_field_assoc(Result, "mute", Query, 5);
- User[playerid][accountMuted] = strval(Query);
- db_get_field_assoc(Result, "mutesec", Query, 8);
- User[playerid][accountMuteSec] = strval(Query);
- db_get_field_assoc(Result, "cmute", Query, 6);
- User[playerid][accountCMuted] = strval(Query);
- db_get_field_assoc(Result, "cmutesec", Query, 9);
- User[playerid][accountCMuteSec] = strval(Query);
- db_get_field_assoc(Result, "jail", Query, 5);
- User[playerid][accountJail] = strval(Query);
- db_get_field_assoc(Result, "jailsec", Query, 8);
- User[playerid][accountJailSec] = strval(Query);
- db_get_field_assoc(Result, "hours", Query, 6);
- User[playerid][accountGame][2] = strval(Query);
- db_get_field_assoc(Result, "minutes", Query, 8);
- User[playerid][accountGame][1] = strval(Query);
- db_get_field_assoc(Result, "seconds", Query, 8);
- User[playerid][accountGame][0] = strval(Query);
- User[playerid][accountLogged] = true;
- if(User[playerid][accountMuted] == 1)
- {
- format(string, 200, "PUNISHMENT: You have been muted from using the chat for %d seconds, You are muted the last time you logged out.", User[playerid][accountMuteSec]);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- if(User[playerid][accountCMuted] == 1)
- {
- format(string, 200, "PUNISHMENT: You have been muted from using the commands for %d seconds, You are muted the last time you logged out.", User[playerid][accountCMuteSec]);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- SendClientMessage(playerid, COLOR_YELLOW, "SERVER: You have successfully logged in to the server.");
- if(User[playerid][accountAdmin] >= 1)
- {
- SendClientMessage(playerid, -1, "You have logged into your administrative account, Good luck doing your duties.");
- }
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- }
- db_free_result(Result);
- return 1;
- }
- function:IsValidPassword( const password[ ] )
- {
- for( new i = 0; password[ i ] != EOS; ++i )
- {
- switch( password[ i ] )
- {
- case '0'..'9', 'A'..'Z', 'a'..'z': continue;
- default: return 0;
- }
- }
- return 1;
- }
- stock DB_Escape(text[])
- {
- new
- ret[80* 2],
- ch,
- i,
- j;
- while ((ch = text[i++]) && j < sizeof (ret))
- {
- if (ch == '\'')
- {
- if (j < sizeof (ret) - 2)
- {
- ret[j++] = '\'';
- ret[j++] = '\'';
- }
- }
- else if (j < sizeof (ret))
- {
- ret[j++] = ch;
- }
- else
- {
- j++;
- }
- }
- ret[sizeof (ret) - 1] = '\0';
- return ret;
- }
- stock ShowBan(playerid, admin[] = "JakAdmin3", reason[] = "69 Sex", when[] = "01/01/1970 00:00:00")
- {
- new string[256], string2[1500];
- for(new i=0; i<100; i++)
- {
- SendClientMessage(playerid, -1, " ");
- }
- format(string, 256, "You're banned from server by %s for the following reasons:", admin);
- SendClientMessage(playerid, COLOR_RED, string);
- format(string, 256, "(( %s ))", reason);
- SendClientMessage(playerid, -1, string);
- strcat(string2, ""grey"");
- strcat(string2, "You are banned from this server, Statistics of your ban:\n\n");
- format(string, 256, ""white"Name: "red"%s\n", pName(playerid));
- strcat(string2, string);
- format(string, 256, ""white"Banned By: "red"%s\n", admin);
- strcat(string2, string);
- format(string, 256, ""white"Reason: "red"%s\n", reason);
- strcat(string2, string);
- format(string, 256, ""white"IP: "red"%s\n", User[playerid][accountIP]);
- strcat(string2, string);
- format(string, 256, ""white"Banned since: "red"%s\n\n", when);
- strcat(string2, string);
- strcat(string2, ""grey"");
- strcat(string2, "If you think this is a bugged, false ban or the admin abused his/her power, Please place a ban appeal on forums.\n");
- strcat(string2, "Make sure to take a picture of this by pressing F8, Do not lie on your appeal.");
- SD(playerid, DIALOG_BEGIN, DM, ""red"You are banned from this server.", string2, "Close", "");
- return 1;
- }
- stock BanAccountEx(name[], ip[], admin[] = "Anticheat", reason[] = "None")
- {
- new
- Query[500],
- DBResult:result,
- ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years, when[128]
- ;
- gettime(ban_hr, ban_min, ban_sec);
- getdate(ban_years, ban_month, ban_days);
- format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
- format(Query, 500, "INSERT INTO `bans` (`username`, `ip`, `banby`, `banreason`, `banwhen`) VALUES ('%s', '%s', '%s', '%s', '%s')", DB_Escape(name), DB_Escape(ip), DB_Escape(admin), DB_Escape(reason), DB_Escape(when));
- result = db_query(Database, Query);
- db_free_result(result);
- return 1;
- }
- stock BanAccount(playerid, admin[] = "Anticheat", reason[] = "None")
- {
- new
- Query[500],
- DBResult:result,
- ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years, when[128]
- ;
- gettime(ban_hr, ban_min, ban_sec);
- getdate(ban_years, ban_month, ban_days);
- format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
- format(Query, 500, "INSERT INTO `bans` (`username`, `ip`, `banby`, `banreason`, `banwhen`) VALUES ('%s', '%s', '%s', '%s', '%s')", DB_Escape(pName(playerid)), DB_Escape(User[playerid][accountIP]), DB_Escape(admin), DB_Escape(reason), DB_Escape(when));
- result = db_query(Database, Query);
- db_free_result(result);
- return 1;
- }
- function:j_CountCmds()
- {
- new
- cmdBuffer[32],
- commandCount;
- for(new it = 0; it < Scripting_GetPublicsCount(); it++)
- {
- Scripting_GetPublic(it, cmdBuffer);
- if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
- commandCount++;
- }
- }
- return commandCount;
- }
- function:IsValidWeapon(weaponid)
- {
- if (weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47) return 1;
- return 0;
- }
- function:SaveLog(filename[], text[])
- {
- #if LOG == true
- new string[256];
- if(!fexist(_LOG_))
- {
- printf("[JakAdmin3] Unable to overwrite '%s' at the '%s', '%s' missing.", filename, _LOG_, _LOG_);
- print("No logs has been saved to your server database.");
- format(string, sizeof string, "JakAdmin3 has attempted to overwrite '%s' at the '%s' which is missing.", filename, _LOG_);
- SendAdmin(COLOR_RED, string);
- SendAdmin(-1, "No logs has been saved to the server database, Check the console for further solution.");
- return 0;
- }
- new File:file,
- filepath[128+40]
- ;
- new year, month, day;
- new hour, minute, second;
- getdate(year, month, day);
- gettime(hour, minute, second);
- format(filepath, sizeof(filepath), ""_LOG_"%s", filename);
- file = fopen(filepath, io_append);
- format(string, sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n", month, day, year, hour, minute, second, text);
- fwrite(file, string);
- fclose(file);
- #endif
- return 1;
- }
- stock VehicleOccupied(vehicleid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInVehicle(i, vehicleid)) return 1;
- }
- return 0;
- }
- stock DataExist(name[])
- {
- new Buffer[180],
- Entry,
- DBResult:Result
- ;
- format(Buffer, sizeof(Buffer), "SELECT `userid` FROM `users` WHERE `username` = '%s'", name);
- Result = db_query(Database, Buffer);
- if(Result)
- {
- if(db_num_rows(Result))
- {
- Entry = 1;
- db_free_result(Result);
- }
- else Entry = 0;
- }
- return Entry;
- }
- stock SendAdmin(color, string[])
- {
- foreach(new i : Player)
- {
- if(User[i][accountAdmin] >= 1)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- #if ANTI_SWEAR == true
- stock Cenzura(string[], words[], destch = '*')
- {
- new start_index = (-1),
- end_index = (-1);
- start_index = strfind(string, words, true);
- if(start_index == (-1)) return false;
- end_index = (start_index+strlen(words));
- for( ; start_index < end_index; start_index++)
- string[start_index] = destch;
- return true;
- }
- #endif
- stock StartSpectate(playerid, specplayerid)
- {
- foreach(new x : Player)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
- {
- AdvanceSpectate(x);
- }
- }
- SetPlayerInterior(playerid, GetPlayerInterior(specplayerid));
- TogglePlayerSpectating(playerid, 1);
- if(IsPlayerInAnyVehicle(specplayerid))
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specplayerid));
- User[playerid][SpecID] = specplayerid;
- User[playerid][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
- }
- else
- {
- PlayerSpectatePlayer(playerid, specplayerid);
- User[playerid][SpecID] = specplayerid;
- User[playerid][SpecType] = ADMIN_SPEC_TYPE_PLAYER;
- }
- return 1;
- }
- stock StopSpectate(playerid)
- {
- TogglePlayerSpectating(playerid, 0);
- User[playerid][SpecID] = INVALID_PLAYER_ID;
- User[playerid][SpecType] = ADMIN_SPEC_TYPE_NONE;
- GameTextForPlayer(playerid,"~n~~n~~n~~w~Spectate mode ended",1000,3);
- return 1;
- }
- stock AdvanceSpectate(playerid)
- {
- if(Iter_Count(Player) == 2) { StopSpectate(playerid); return 1; }
- if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
- {
- for(new x=User[playerid][SpecID]+1; x<=MAX_PLAYERS; x++)
- {
- if(x == MAX_PLAYERS) x = 0;
- if(IsPlayerConnected(x) && x != playerid)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
- {
- continue;
- }
- else
- {
- StartSpectate(playerid, x);
- break;
- }
- }
- }
- }
- return 1;
- }
- stock ReverseSpectate(playerid)
- {
- if(Iter_Count(Player) == 2) { StopSpectate(playerid); return 1; }
- if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
- {
- for(new x=User[playerid][SpecID]-1; x>=0; x--)
- {
- if(x == 0) x = MAX_PLAYERS;
- if(IsPlayerConnected(x) && x != playerid)
- {
- if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
- {
- continue;
- }
- else
- {
- StartSpectate(playerid, x);
- break;
- }
- }
- }
- }
- return 1;
- }
- stock GetVehicleModelIDFromName(vname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if ( strfind(VehicleNames[i], vname, true) != -1 )
- return i + 400;
- }
- return -1;
- }
- function:EraseVeh(vehicleid)
- {
- foreach(new i : Player)
- {
- new Float:X, Float:Y, Float:Z;
- if(IsPlayerInVehicle(i, vehicleid))
- {
- RemovePlayerFromVehicle(i);
- GetPlayerPos(i, X, Y, Z);
- SetPlayerPos(i, X, Y+3, Z);
- }
- SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
- }
- SetTimerEx("VehRes", 1500, 0, "i", vehicleid);
- }
- function:DelVehicle(vehicleid)
- {
- foreach(new players : Player)
- {
- new Float:X, Float:Y, Float:Z;
- if(IsPlayerInVehicle(players, vehicleid))
- {
- GetPlayerPos(players, X, Y, Z);
- SetPlayerPos(players, X, Y, Z+2);
- SetVehicleToRespawn(vehicleid);
- }
- SetVehicleParamsForPlayer(vehicleid, players, 0, 1);
- }
- SetTimerEx("VehRes", 3000, 0, "d", vehicleid);
- return 1;
- }
- stock Config()
- {
- print("\n");
- /*
- Don't blame me, Can't find a nice solution of detecting it, So i will do it
- on my own way - I will find a proper code to optimize this on the next
- version.
- */
- new
- log,
- autolog,
- dialog,
- readcmd,
- maxping,
- antiswear,
- antiname,
- antispawn,
- antiad,
- rconpass,
- antispam,
- on[3] ="ON",
- off[4] = "OFF"
- ;
- log = 0; autolog = 0; dialog = 0; readcmd = 0; maxping = 0; antiswear = 0;
- antiname = 0; antispawn = 0; antiad =0; rconpass=0; antispam = 0;
- #if LOG == true
- log = 1;
- #endif
- #if AUTO_LOGIN == true
- autolog = 1;
- #endif
- #if REGISTER_DIALOG == true
- dialog = 1;
- #endif
- #if READ_COMMANDS == true
- readcmd = 1;
- #endif
- #if MAX_PING == true
- maxping = 1;
- #endif
- #if ANTI_SWEAR == true
- antiswear = 1;
- #endif
- #if ANTI_NAME == true
- antiname = 1;
- #endif
- #if ANTI_SPAWN == true
- antispawn = 1;
- #endif
- #if ANTI_AD == true
- antiad = 1;
- #endif
- #if RconProtect == true
- rconpass = 1;
- #endif
- #if AntiSpam == true
- antispam = 1;
- #endif
- print("***** JaKe's Administration System Configuration *****");
- printf("LogSaving: %s, AutoLogin: %s, Dialog: %s, ReadCommands: %s, MaxPing: %s", log ? on : off, autolog ? on : off, dialog ? on : off, readcmd ? on : off, maxping ? on : off);
- printf("AntiSwear: %s, AntiName: %s, AntiSpawn: %s, AntiAd: %s, RCONProtect: %s", antiswear ? on : off, antiname ? on : off, antispawn ? on : off, antiad ? on : off, rconpass ? on : off);
- printf("AntiSpam: %s", antispam ? on : off);
- #if MAX_PING == true
- printf("MaxPing Limit: %d", PING_EXCEED);
- #endif
- }
- function:VehRes(vehicleid)
- {
- DestroyVehicle(vehicleid);
- }
- stock TimeStamp()
- {
- new time = GetTickCount() / 1000;
- return time;
- }
- function:checkfolderEx()
- {
- if(!fexist("JakAdmin3/"))
- {
- return 0;
- }
- if(!fexist("JakAdmin3/Logs/"))
- {
- return 0;
- }
- return 1;
- }
- function:checkfolder()
- {
- if(!fexist("JakAdmin3/"))
- {
- print("\n[JakAdmin3]: JakAdmin3 folder doesn't exist in scriptfiles, JakAdmin3 won't start.");
- print("Solution: Create the folder JakAdmin3 on the scriptfiles.");
- print("Continusly using the script with the missing file will not save the target script objective.\n");
- return 0;
- }
- if(!fexist("JakAdmin3/Logs/"))
- {
- print("\n[JakAdmin3]: Logs folder doesn't exist in JakAdmin3 folder, JakAdmin3 won't start.");
- print("Solution: Create the folder Logs on the JakAdmin3 folder.");
- print("Continusly using the script with the missing file will not save the target script objective.\n");
- return 0;
- }
- return 1;
- }
- function:PosAfterSpec(playerid)
- {
- SetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
- SetPlayerFacingAngle(playerid, SpecPos[playerid][3]);
- SetPlayerInterior(playerid, SpecInt[playerid][0]);
- SetPlayerVirtualWorld(playerid, SpecInt[playerid][1]);
- }
- /*******************************************************************************
- * End of the Script - JakAdmin3 (c), January 2015 *
- ******************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement