Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* GGGGGGGGGGGGGGGGGGG MMMMM MMMMM
- GGGGGGGGGGGGGGGGGGGG MM M M MM
- GG MM M M MM
- GG MM M M MM
- GG MM M M MM
- GG GGGGGGGGGGGGGG MM M MM
- GG GGGGGGGGGGGGGG MM MM
- GG GG MM MM
- GG GG MM MM
- GGGGGGGGGGGGGGGGGGGG MM MM
- GGGGGGGGGGGGGGGGGGG MM MM
- */
- /* Credits Goes To
- GameMode : Golden DM
- Created By
- GoldenMan
- Commands : Admin System [Only] & Commands
- Please dont remove credits */
- //================= INCLUDES =================//
- #include <a_samp>
- #include <streamer>
- #include <sscanf2>
- #include <YSI\y_ini>
- #include <dini>
- #include <zcmd>
- //================= SERVER ENTITIES =================//
- #define GM_TEXT "Golden DM"
- #define SERVER_NAME "Golden DM Simple Created By GoldenMan"
- #define SERVER_RCON "golden"
- #define SERVER_URL "www.goldenman.com"
- #define SERVER_MAPNAME "Special DM"
- #define SERVER_LANGUAGE "English"
- //================= DIALOGS =================//
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- #define DIALOG_VIP_MENU 5
- #define NEON 6
- #define WEAPON_SHOP 7
- //================= Defines =================//
- #define MaxMoney 999999999
- #define SCM SendClientMessage
- #define SCMTA SendClientMessageToAll
- #define MAX_VEHICLE_MODELS 600
- //================= New Defines =================//
- new gTimeStats[2];
- new Text:Date;
- new Text:Line1;
- new Text:Line2;
- new Text:Time;
- //================= PATHS =================//
- #define PATH "/Accounts/userfiles/%s.ini"
- //================= COLOURS =================//
- #define COLOR_DARKRED 0xAA3333FF
- #define RED 0xFF0000C8
- #define COLOR_GREY 0xAFAFAFFF
- #define COLOR_ASAY 0xFF0000FF
- #define COLOR_OSAY 0x007700FF
- #define COLOR_HSAY 0x1684CAFF
- #define COLOR_MSAY 0x1684CAFF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_RED 0xFF0000FF
- #define COLOR_LRED 0xFF4747FF
- #define COLOR_GREEN 0x00FF00FF
- #define COLOR_BLUE 0x0000FFFF
- #define COLOR_LBLUE 0x99FFFFFF
- #define COLOR_LIGHTBLUE 0x99FFFFFF
- #define COLOR_ORANGE 0xFF9900FF
- #define COLOR_PURPLE 0xCC00DDFF
- #define COLOR_PEACH 0xFFCC66FF
- #define COLOR_SILVER 0xDDDDDDFF
- #define COLOR_WANTEDBLUE 0x0055CCFF
- #define COLOR_DARK_VIOLET 0x9400D3FF
- #define COLOR_VIP1 0x9400D3FF
- #define COLOR_HELP 0x00E5EEFF
- #define COLOR_ADMIN 0x0066FFFF
- #define COLOR_ADMIN2 0x008FD6FF
- #define COLOR_PLAYER 0xFFFF33FF
- #define COLOR_ULTRAADMIN 0x993300FF
- #define COLOR_EVENT 0x00CC66FF
- #define COLOR_VIP2 0xFF33CCFF
- #define COLOR_VIPCHAT 0xCC66CCFF
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- //================= ADMINS COLOUR =================//
- #define COLOR_ADMIN_1 0x009933FF
- #define COLOR_ADMIN_2 0xFFAD5CFF
- #define COLOR_ADMIN_3 0xFF0000FF
- #define LEVEL_1_COLOR "{FF0000}"
- #define LEVEL_2_COLOR "{00FFFF}"
- #define LEVEL_3_COLOR "{FFAD5C}"
- #define LEVEL_4_COLOR "{FF0000}"
- #define LEVEL_5_COLOR "{FF0000}"
- #define LEVEL_6_COLOR "{FF0000}"
- #define LEVEL_7_COLOR "{008800}"
- //================= MAIN =================//
- main()
- {
- print("\n=====================================");
- print("===============Created By=============");
- print("================GoldenMan=============");
- print("======================================\n");
- print("\n=============================================================");
- print("GGGGGGGGGGGGGGGGGGG MMMMM MMMMM ");
- print("GGGGGGGGGGGGGGGGGGGG MM M M MM ");
- print("GG MM M M MM ");
- print("GG MM M M MM ");
- print("GG MM M M MM ");
- print("GG GGGGGGGGGGGGGG MM M MM ");
- print("GG GGGGGGGGGGGGGG MM MM ");
- print("GG GG MM MM ");
- print("GG GG MM MM ");
- print("GGGGGGGGGGGGGGGGGGGG MM MM ");
- print(" GGGGGGGGGGGGGGGGGGG MM MM ");
- print("=============================================================\n");
- print("\n=====================================");
- print("Server Loaded Successfully");
- print("======================================\n");
- }
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- /*Credits to Dracoblue*/
- stock udb_hash(buf[]) {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- new vehicle_spawn[MAX_PLAYERS];
- new NameVehicles[][] = // Name the all vehicles
- {
- "Landstalker",
- "Bravura",
- "Buffalo",
- "Linerunner",
- "Perrenial",
- "Sentinel",
- "Dumper",
- "Firetruck",
- "Trashmaster",
- "Stretch",
- "Manana",
- "Infernus",
- "Voodoo",
- "Pony",
- "Mule",
- "Cheetah",
- "Ambulance",
- "Leviathan",
- "Moonbeam",
- "Esperanto",
- "Taxi",
- "Washington",
- "Bobcat",
- "Whoopee",
- "BF Injection",
- "Hunter",
- "Premier",
- "Enforcer",
- "Securicar",
- "Banshee",
- "Predator",
- "Bus",
- "Rhino",
- "Barracks",
- "Hotknife",
- "Trailer", "Previon", "Coach", "Cabbie",
- "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
- "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "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", "Cropduster", "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", "Hustler", "Intruder", "Primo",
- "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
- "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
- "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
- "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
- "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
- "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
- "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
- "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
- "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
- "Tiller", "Utility Trailer"
- };
- stock IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0')
- return 0;
- }
- return true;
- }
- stock GetModelVehicle(vname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if(strfind(NameVehicles[i], vname, true) != -1)
- return i + 400;
- }
- return false;
- }
- stock CreateVehicleEx(playerid, modelid)
- {
- new Float:pos[4];
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- GetVehiclePos(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), pos[3]);
- DestroyVehicle(GetPlayerVehicleID(playerid));
- }
- else
- {
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- GetPlayerFacingAngle(playerid, pos[3]);
- }
- if(vehicle_spawn[playerid] != 0) DestroyVehicle(vehicle_spawn[playerid]);
- vehicle_spawn[playerid] = CreateVehicle(modelid, pos[0], pos[1], pos[2], pos[3], -1, -1, 60);
- LinkVehicleToInterior(vehicle_spawn[playerid], GetPlayerInterior(playerid));
- SetVehicleVirtualWorld(vehicle_spawn[playerid], GetPlayerVirtualWorld(playerid));
- PutPlayerInVehicle(playerid, vehicle_spawn[playerid], 0);
- SetVehicleZAngle(vehicle_spawn[playerid], pos[3]);
- return true;
- }
- forward Restart();
- public OnGameModeInit()
- {
- SetGameModeText(""GM_TEXT"");
- SendRconCommand("hostname "SERVER_NAME"");
- SendRconCommand("rcon_password "SERVER_RCON"");
- SendRconCommand("weburl "SERVER_URL"");
- SendRconCommand("mapname "SERVER_MAPNAME"");
- SendRconCommand("language "SERVER_LANGUAGE"");
- //Clock System
- Date = TextDrawCreate(45.000000, 326.000000, "06/04/2015");
- TextDrawBackgroundColor(Date, 255);
- TextDrawFont(Date, 3);
- TextDrawLetterSize(Date, 0.509999, 1.000000);
- TextDrawColor(Date, -1);
- TextDrawSetOutline(Date, 0);
- TextDrawSetProportional(Date, 1);
- TextDrawSetShadow(Date, 1);
- Line1 = TextDrawCreate(36.000000, 332.000000, "_");
- TextDrawBackgroundColor(Line1, 255);
- TextDrawFont(Line1, 1);
- TextDrawLetterSize(Line1, 6.699995, 1.000000);
- TextDrawColor(Line1, 16711935);
- TextDrawSetOutline(Line1, 0);
- TextDrawSetProportional(Line1, 1);
- TextDrawSetShadow(Line1, 1);
- Line2 = TextDrawCreate(36.000000, 318.000000, "_");
- TextDrawBackgroundColor(Line2, 255);
- TextDrawFont(Line2, 1);
- TextDrawLetterSize(Line2, 6.699995, 1.000000);
- TextDrawColor(Line2, 16711935);
- TextDrawSetOutline(Line2, 0);
- TextDrawSetProportional(Line2, 1);
- TextDrawSetShadow(Line2, 1);
- Time = TextDrawCreate(49.000000, 311.000000, "00:00:00");
- TextDrawBackgroundColor(Time, 255);
- TextDrawFont(Time, 1);
- TextDrawLetterSize(Time, 0.500000, 1.000000);
- TextDrawColor(Time, -1);
- TextDrawSetOutline(Time, 0);
- TextDrawSetProportional(Time, 1);
- TextDrawSetShadow(Time, 1);
- SetTimer("time", 1000, true);
- //==========================PLAYER CLASSES======================//
- AddPlayerClass(1,404.9409,2533.1892,16.5460,182.0441,6,1,26,100,33,100); //
- AddPlayerClass(2,323.5802,2524.5325,16.7525,264.4515,6,1,26,100,33,100); //
- AddPlayerClass(3,395.1288,2465.5244,16.5000,230.9245,6,1,26,100,33,100); //
- AddPlayerClass(4,416.5731,2448.1128,16.5000,230.9245,6,1,26,100,33,100); //
- AddPlayerClass(5,162.6355,2377.0325,16.5000,78.3297,6,1,26,100,33,100); //
- AddPlayerClass(6,-95.1950,2458.6848,16.5000,77.0764,6,1,26,100,33,100); //
- AddPlayerClass(7,14.1675,2504.2317,16.5000,276.9616,6,1,26,100,33,100); //
- AddPlayerClass(8,231.6018,2497.9978,16.5000,268.5015,6,1,26,100,33,100); //
- AddPlayerClass(9,305.6609,2523.2061,16.5000,248.4481,6,1,26,100,33,100); //
- AddPlayerClass(10,432.4329,2523.0779,16.5000,272.2617,6,1,26,100,33,100); //
- AddPlayerClass(11,404.0999,2465.7368,16.5000,185.1542,6,1,26,100,33,100); //
- AddPlayerClass(12,404.0999,2465.7368,16.5000,185.1542,6,1,26,100,33,100); //
- AddPlayerClass(13,404.0999,2465.7368,16.5000,185.1542,6,1,26,100,33,100); //
- AddPlayerClass(14,404.0999,2465.7368,17.0121,185.1542,6,1,26,100,33,100); //
- AddPlayerClass(15,404.0999,2465.7368,17.4653,185.1542,6,1,26,100,33,100); //
- AddPlayerClass(16,404.0999,2465.7368,17.4653,185.1542,6,1,26,100,33,100); //
- //=============================VEHICLES============================//
- AddStaticVehicle(411,388.9364,2531.0940,16.2702,89.7920,123,1); //
- AddStaticVehicle(425,368.9612,2536.5000,17.2309,87.6655,43,0); //
- AddStaticVehicle(522,366.1923,2479.3894,16.0380,271.3551,7,79); //
- AddStaticVehicle(522,378.3987,2479.3911,16.0502,270.0639,7,79); //
- AddStaticVehicle(522,419.1019,2480.8162,16.0477,271.4123,7,79); //
- AddStaticVehicle(522,429.3909,2490.4470,16.0432,355.7974,7,79); //
- AddStaticVehicle(522,429.6454,2508.3865,16.0505,359.3569,7,79); //
- AddStaticVehicle(451,422.2503,2441.0530,16.2070,175.3576,125,125); //
- AddStaticVehicle(451,422.8609,2460.1836,16.2063,180.0902,125,125); //
- AddStaticVehicle(451,389.8860,2461.3511,16.2060,355.4984,125,125); //
- AddStaticVehicle(451,388.3862,2442.3047,16.2076,355.4980,125,125); //
- AddStaticVehicle(451,160.2561,2473.6548,16.1889,13.5081,125,125); //
- AddStaticVehicle(451,205.3321,2479.5022,16.1990,284.2957,125,125); //
- AddStaticVehicle(451,255.8866,2518.4014,16.3580,50.2630,125,125); //
- AddStaticVehicle(522,-3.0093,2527.9309,16.0552,89.2382,36,105); //
- AddStaticVehicle(522,-76.6719,2479.4155,16.0477,145.3996,36,105); //
- AddStaticVehicle(522,-17.8494,2484.9229,16.0497,246.4063,36,105); //
- AddStaticVehicle(411,287.1540,2542.9355,16.5467,356.2872,116,1); //
- AddStaticVehicle(411,296.9729,2542.2698,16.5485,2.3036,116,1); //
- AddStaticVehicle(411,305.4609,2426.9041,16.2036,249.5041,116,1); //
- AddStaticVehicle(411,221.4702,2475.6831,16.2114,292.2923,116,1); //
- AddStaticVehicle(411,140.5230,2555.6575,16.3451,87.3846,116,1); //
- AddStaticVehicle(411,54.9136,2556.4802,16.2445,91.3709,116,1); //
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- // Player name Stock
- stock PlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- return name;
- }
- stock RPN(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- stock ALVLCN(lvl)
- {
- new string[128], str[256], str2[256];
- format(str, sizeof(str), "admincolorlevel%d", lvl);
- format(str2, sizeof(str2), "adminnamelevel%d", lvl);
- format(string, 128, "{%s} %s", dini_Get(AddDirFile(dir_datafiles, FILE_ACN), str), dini_Get(AddDirFile(dir_datafiles, FILE_ACN), str2));
- return string;
- }
- // Send Messge to Amdins
- SendMessageToAdmins(color, message[])
- {
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i) && PlayerInfo[i][pAdmin] != 0) SendClientMessage(i, color, message);
- }
- }
- /*SendMessageToNormal(color, message[])
- {
- for(new i = 0; i< PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && adlvl[i] == 0) SendClientMessage(i, color, message);
- }
- }
- SendMessageToVips(color, message[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && vip[i] != 0) SendClientMessage(i, color, message);
- }
- }*/
- /*MyTest(color, message[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && Team[i] == 1) SendClientMessage(i, color, message);
- }
- }*/
- /*SendToPlayer(color, message[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && Team1[i] == 2) SendClientMessage(i, color, message);
- }
- }
- SendMessageToTesting(color, message[])
- {
- new playername[64];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- GetPlayerName(i, playername, MAX_PLAYER_NAME);
- if(IsPlayerConnected(i) && dini_Int(AddDirFile(dir_userfiles, playername), "Testing") == 1) SendClientMessage(i, color, message);
- }
- }*/
- public Restart()
- {
- for(new i=0; i<MAX_PLAYERS; i++) {if(IsPlayerConnected(i)) Kick(i);}
- SendRconCommand("gmx");
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 403.544, 2470.676, 29.605);
- SetPlayerCameraPos(playerid, 408.544, 2470.676, 29.605);
- SetPlayerCameraLookAt(playerid, 408.544, 2470.676, 29.605);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, COLOR_BLUE,"Welcome In "SERVER_NAME"");
- SCM(playerid, COLOR_RED,"Please read /rules, /cmds");
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid, Date);
- TextDrawHideForPlayer(playerid, Line1);
- TextDrawHideForPlayer(playerid, Line2);
- TextDrawHideForPlayer(playerid, Time);
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, Date);
- TextDrawShowForPlayer(playerid, Line1);
- TextDrawShowForPlayer(playerid, Line2);
- TextDrawShowForPlayer(playerid, Time);
- return 1;
- }
- forward time();
- public time()
- {
- new string[256], year, month, day, hours, minutes, seconds;
- getdate(year, month, day), gettime(hours, minutes, seconds);
- format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
- TextDrawSetString(Date, string);
- format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
- TextDrawSetString(Time, string);
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"{008800}Register",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_Close(File);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"{FF0000}Thanks For Choosing Our Server!",""COL_GREEN"Welcome In "SERVER_NAME"","Ok","");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"{0088CB}Thanks For Coming Back",""COL_GREEN"You have successfully logged in!","Ok","");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"{0000FF}Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- }
- if(dialogid == NEON)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SetPVarInt(playerid, "neon", 1);
- SetPVarInt(playerid, "blue", CreateObject(18648,0,0,0,0,0,0));
- SetPVarInt(playerid, "blue1", CreateObject(18648,0,0,0,0,0,0));
- AttachObjectToVehicle(GetPVarInt(playerid, "blue"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(GetPVarInt(playerid, "blue1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, "~b~ Blue ~r~Colour Neon Has Been Added To Your Vehicle",3500,5);
- }
- if(listitem == 1)
- {
- SetPVarInt(playerid, "neon", 1);
- SetPVarInt(playerid, "green", CreateObject(18649,0,0,0,0,0,0));
- SetPVarInt(playerid, "green1", CreateObject(18649,0,0,0,0,0,0));
- AttachObjectToVehicle(GetPVarInt(playerid, "green"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(GetPVarInt(playerid, "green1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, "~g~Green ~r~Colour Neon Has Been Added To Your Vehicle",3500,5);
- }
- if(listitem == 2)
- {
- SetPVarInt(playerid, "neon", 1);
- SetPVarInt(playerid, "yellow", CreateObject(18650,0,0,0,0,0,0));
- SetPVarInt(playerid, "yellow1", CreateObject(18650,0,0,0,0,0,0));
- AttachObjectToVehicle(GetPVarInt(playerid, "yellow"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(GetPVarInt(playerid, "yellow1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, "~y~Yellow ~r~Colour Neon Has Been Added To Your Vehicle",3500,5);
- }
- if(listitem == 3)
- {
- SetPVarInt(playerid, "neon", 1);
- SetPVarInt(playerid, "white", CreateObject(18652,0,0,0,0,0,0));
- SetPVarInt(playerid, "white1", CreateObject(18652,0,0,0,0,0,0));
- AttachObjectToVehicle(GetPVarInt(playerid, "white"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(GetPVarInt(playerid, "white1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, "~w~White ~r~Colour Neon Has Been Added To Your Vehicle",3500,5);
- }
- if(listitem == 4)
- {
- SetPVarInt(playerid, "neon", 1);
- SetPVarInt(playerid, "pink", CreateObject(18651,0,0,0,0,0,0));
- SetPVarInt(playerid, "pink1", CreateObject(18651,0,0,0,0,0,0));
- AttachObjectToVehicle(GetPVarInt(playerid, "pink"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(GetPVarInt(playerid, "pink1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- GameTextForPlayer(playerid, "~p~Pink ~r~Colour Neon Has Been Added To Your Vehicle",3500,5);
- }
- if(listitem == 5)
- {
- DestroyObject(GetPVarInt(playerid, "blue"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "blue1"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "green"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "green1"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "yellow"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "yellow1"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "white"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "white1"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "pink"));
- DeletePVar(playerid, "neon");
- DestroyObject(GetPVarInt(playerid, "pink1"));
- DeletePVar(playerid, "neon");
- GameTextForPlayer(playerid, "~p~Neon is removed from your vehicle",3500,5);
- }
- }
- }
- if(dialogid == WEAPON_SHOP)
- {
- if(response)
- {
- if(listitem == 0)
- GivePlayerWeapon(playerid, 28, 5000);
- GivePlayerWeapon(playerid, 26, 5000);
- GivePlayerWeapon(playerid, 30, 5000);
- GivePlayerWeapon(playerid, 24, 5000);
- GivePlayerMoney (playerid, -10000);
- SendClientMessage(playerid, COLOR_RED, "You have selected Package 1 - {008800}Shawn-OFF Shotgun, UZI, Desert Eagle, AK47. With {00FF00}1000 Bullets .");
- }
- if(listitem == 1)
- {
- GivePlayerWeapon(playerid, 29, 5000);
- GivePlayerWeapon(playerid, 31, 5000);
- GivePlayerWeapon(playerid, 34, 5000);
- GivePlayerWeapon(playerid, 25, 5000);
- GivePlayerMoney (playerid, -11000);
- SendClientMessage(playerid, COLOR_RED, "You have selected Package 2 - {00FF00}MP5, M4, Sniper, ShotGun With {008800}1000 Bullets ");
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- //============================= COMMANDS =============================//
- CMD:cmds(playerid, params[])
- {
- return cmd_commands(playerid, params);
- }
- CMD:commands(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Server Commands");
- SendClientMessage(playerid, COLOR_WHITE, "/admins, /id, /vipinfo, /drink, /clock");
- return 1;
- }
- CMD:vipinfo(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_BLUE,"This is vip informaton menu");
- {
- ShowPlayerDialog(playerid, DIALOG_VIP_MENU, DIALOG_STYLE_MSGBOX, "VIP Information", "{00FF00}Price 2$\n{008800}Will Get $7000000 In Game Cash\nWill Get Admin Level 2\n", "Ok", "");
- }
- return 1;
- }
- CMD:neon(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You should a driver");
- return 1;
- }
- ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Choose Neon Colour","Blue\nGreen\nYellow\nWhite\nPink\nRemove Neon","Add","Cancel");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Please Sit In Vehicle");
- }
- return 1;
- }
- CMD:id(playerid,params[])
- {
- new TargetID,str1[270],pname[MAX_PLAYER_NAME];
- if(sscanf(params,"u",TargetID)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /id [Player Name/ID]");
- if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID)) return SendClientMessage(playerid, COLOR_SILVER, "Player Is Not Connected.");
- else
- {
- GetPlayerName(TargetID,pname,sizeof(pname));
- format(str1,sizeof(str1),"%s {FF0000}[ID = %d] {008800}[Ping: %d]",pname,TargetID,GetPlayerPing(TargetID));
- SendClientMessage(playerid,COLOR_GREEN,str1);
- }
- return 1;
- }
- CMD:drink(playerid, params[])
- {
- new options[128];
- if(sscanf(params, "s[128]",options))
- {
- SendClientMessage(playerid, COLOR_WHITE, "Usage: /drink [Wine Or Beer]");
- SendClientMessage(playerid, COLOR_SILVER, "{00FF00}Wine, Beer");
- return 1;
- }
- else if(!strcmp(options, "Wine", true, 5))
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
- SendClientMessage(playerid, COLOR_WHITE, "You got wine {00FF00}Press LMB to start drink");
- }
- else if(!strcmp(options, "Beer", true, 5))
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You got beer {00FF00}Press LMB to start drink");
- }
- else SendClientMessage(playerid, COLOR_RED, "Invalid Option.");
- return 1;
- }
- CMD:acmds(playerid, params[])
- {
- new cmds;
- if(PlayerInfo[playerid][pAdmin] < 1) return 0;
- {
- new tmp[256];
- if(PlayerInfo[playerid][pAdmin] == 1)
- {
- format(tmp, sizeof(tmp), "Trial Moderator {FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/kick, /clear");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] == 2)
- {
- if(sscanf(params, "i", cmds)) return SendClientMessage(playerid, COLOR_YELLOW, "You admin level has too many commands do /acmds [1-2]");
- switch(cmds)
- {
- case 1:
- {
- format(tmp, sizeof(tmp), "Global Moderator - Page 1{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/kick, /clear, /ban");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- case 2:
- {
- format(tmp, sizeof(tmp), "Global Moderator - Page 2{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- }
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] == 3)
- {
- if(sscanf(params, "i", cmds)) return SendClientMessage(playerid, COLOR_YELLOW, "You admin level has too many commands do /acmds [1-2]");
- switch(cmds)
- {
- case 1:
- {
- format(tmp, sizeof(tmp), "Administrator - Page 1{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/kick, /clear, /ban");
- SendClientMessage(playerid, COLOR_WHITE, "/v");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- case 2:
- {
- format(tmp, sizeof(tmp), "Administrator - Page 2{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- }
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] == 4)
- {
- if(sscanf(params, "i", cmds)) return SendClientMessage(playerid, COLOR_YELLOW, "You admin level has too many commands do /acmds [1-2]");
- switch(cmds)
- {
- case 1:
- {
- format(tmp, sizeof(tmp), "Head Administrator - Page 1{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/kick, /clear, /ban");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- case 2:
- {
- format(tmp, sizeof(tmp), "Head Administrator - Page 2{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- }
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] == 5)
- {
- if(sscanf(params, "i", cmds)) return SendClientMessage(playerid, COLOR_YELLOW, "You admin level has too many commands do /acmds [1-2]");
- switch(cmds)
- {
- case 1:
- {
- format(tmp, sizeof(tmp), " Lead Administrator - Page 1{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/kick, /clear, /ban");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- case 2:
- {
- format(tmp, sizeof(tmp), "Lead Administrator - Page 2{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- }
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] == 6)
- {
- if(sscanf(params, "i", cmds)) return SendClientMessage(playerid, COLOR_YELLOW, "You admin level has too many commands do /acmds [1-2]");
- switch(cmds)
- {
- case 1:
- {
- format(tmp, sizeof(tmp), "Server Manager/Owner - Page 1{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/kick, /clear, /ban");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- case 2:
- {
- format(tmp, sizeof(tmp), "Server Manager/Owner - Page 2{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- }
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] == 7)
- {
- if(sscanf(params, "i", cmds)) return SendClientMessage(playerid, COLOR_YELLOW, "You admin level has too many commands do /acmds [1-2]");
- switch(cmds)
- {
- case 1:
- {
- format(tmp, sizeof(tmp), "Server Developer/Manager/Owner - Page 1{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "/setadmin, /restart, /v");
- SendClientMessage(playerid, COLOR_WHITE, "/healme, /heal");
- SendClientMessage(playerid, COLOR_WHITE, "/givemoney, /gotopos, /pos");
- return 1;
- }
- case 2:
- {
- format(tmp, sizeof(tmp), "Server Developer/Manager/Owner - Page 2{FFFFFF}");
- SendClientMessage(playerid, COLOR_WHITE, tmp);
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- SendClientMessage(playerid, COLOR_WHITE, "soon");
- return 1;
- }
- }
- return 1;
- }
- }
- return 1;
- }
- CMD:settime(playerid, params[])
- {
- new var, playername[64],string[128],strings[150];
- if(PlayerInfo[playerid][pAdmin] < 2) return 0;
- GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
- if (sscanf(params, "d", var)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /settime [time]");
- if(var > 24) return SendClientMessage(playerid, COLOR_RED, "Invalid Hour!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- SetWorldTime(var);
- gTimeStats[1] = 0;
- gTimeStats[0] = var;
- }
- }
- format(string,sizeof(string),"An admin has set server time to %d:00 ", var );
- SendClientMessageToAll(COLOR_GREEN, string);
- format(strings, 128, "Admin Log: %s (Id%d) has changed server time to %d:00.", playername, playerid, var);
- SendMessageToAdmins(COLOR_ADMIN, strings);
- return 1;
- }
- CMD:setadmin(playerid, params[])
- {
- new player, adlvl;
- if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] < 6) return 0;
- else if(sscanf(params, "ui", playerid, adlvl)) return SendClientMessage(playerid, -1, "Usage: /setadmin [id] [level]");
- else if(adlvl < 0 || adlvl > 7) return SendClientMessage(playerid, -1, "Only levels 0-7");
- else if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player Is Not Currently Connected");
- else
- {
- new string[128], string1[128], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
- GetPlayerName(player, pName, sizeof(pName));
- GetPlayerName(playerid, target, sizeof(target));
- format(string, sizeof(string), "You have set %s Admin level to %i", target, adlvl);
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "Your Admin level has been set to %i by %s", adlvl, pName);
- SendClientMessage(player, -1, string1);
- PlayerInfo[player][pAdmin] = adlvl;
- }
- return 1;
- }
- CMD:kick(playerid,params[])
- {
- new player,gname[MAX_PLAYER_NAME],string[125],reason[70];
- if(PlayerInfo[playerid][pAdmin] < 3 || (playerid)) return 0;
- if(sscanf(params,"us[70]",player,reason)) return SendClientMessage(playerid,-1," (ERROR) : /kick [playerid] [reason]");
- GetPlayerName(player,gname,sizeof(gname));
- format(string, sizeof(string), "SERVER SYSTEM: %s has been kicked from the server Reason: %s", gname,reason);
- SendClientMessageToAll( -1, string);
- Kick(player);
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5)
- {
- new player;
- new reason[64];
- new str[128];
- new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Adminname, sizeof(Adminname));
- GetPlayerName(player, Playername, sizeof(Playername));
- if(sscanf(params, "us[64]", player,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");
- if(!IsPlayerConnected(player))
- return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
- SendClientMessageToAll(COLOR_RED, str);
- Ban(player);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to be level 5 to use that command!");
- }
- return 1;
- }
- CMD:healme(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5)
- {
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, COLOR_GREY, "Health has been restored to 100.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:heal(playerid, params[])
- {
- new player;
- if(PlayerInfo[playerid][pAdmin] < 2) return 0;
- if(sscanf(params,"u", player)) return SendClientMessage(playerid, 0xFFFFFFF,"SERVER : Correct usage: /heal [PlayerID]");
- if(!IsPlayerConnected(player)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
- SetPlayerHealth(player, 100);
- return 1;
- }
- CMD:givemoney(playerid, params[])
- {
- new giveplayerid, moneys1, playername[25], giveplayer[25], string[256];
- if (PlayerInfo[playerid][pAdmin] < 3) return 0;
- if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /givemoney [playerid] [amount]");
- if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
- if (moneys1 < 1 || moneys1 > MaxMoney) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid amount.");
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
- GivePlayerMoney(giveplayerid, moneys1);
- if (giveplayerid != playerid)
- {
- format(string, 128, "An admin has given you $%d.", moneys1);
- SendClientMessage(giveplayerid, COLOR_SILVER, string);
- format(string, 128, "You have given %s $%d.", giveplayer, moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- else
- {
- format(string, 128, "You have gave yourself $%d.", moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- /*if (PlayerInfo[playerid][pAdmin] < 7)
- {
- format(string, 128, "Admin Log: %s has given player %s (Id%d) $%d.", playername, giveplayer, giveplayerid, moneys1);
- SendMessageToAdmins(COLOR_ADMIN, string);
- }
- printf("[givemoney] %s has given player %s (Id%d) $%d.", playername, giveplayer, giveplayerid, moneys1);
- new str[256];
- format(str, sizeof(str), "%s has given player %s (Id%d) $%d.\r\n", playername, giveplayer, giveplayerid, moneys1);
- new File: file = fopen("Alog.cfg", io_append);
- fwrite(file, str);
- fclose(file);*/
- return 1;
- }
- CMD:setmoney(playerid, params[])
- {
- new giveplayerid, moneys1, playername[25], giveplayer[25], string[256];
- if (PlayerInfo[playerid][pAdmin] < 3) return 0;
- if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setmoney [playerid] [amount]");
- if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
- if (moneys1 < 0 || moneys1 > MaxMoney) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid amount.");
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
- ResetPlayerMoney(giveplayerid);
- GivePlayerMoney(giveplayerid, moneys1);
- if (giveplayerid != playerid)
- {
- format(string, 128, "Your money has been set to $%d by an admin.", moneys1);
- SendClientMessage(giveplayerid, COLOR_SILVER, string);
- format(string, 128, "You have set %s's money to $%d.", giveplayer, moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- else
- {
- format(string, 128, "You have set your money to $%d.", moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- /*if (PlayerInfo[playerid][pAdmin] < 3)
- {
- format(string, 128, "Admin Log: %s has set player %s's (Id%d) money to $%d.", playername, giveplayer, giveplayerid, moneys1);
- SendMessageToAdmins(COLOR_ADMIN, string);
- }
- printf("[setmoney] %s has set player %s's (Id%d) money to $%d.", playername, giveplayer, giveplayerid, moneys1);
- new str[256];
- format(str, sizeof(str), "%s has set player %s's (Id%d) money to $%d.\r\n", playername, giveplayer, giveplayerid, moneys1);
- new File: file = fopen("Alog.cfg", io_append);
- fwrite(file, str);
- fclose(file);*/
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- new giveplayerid, moneys1, giveplayer[25], playername[25], string[256];
- if (PlayerInfo[playerid][pAdmin] < 3) return 0;
- if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /sethealth [playerid] [health]");
- if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
- if (moneys1 < 0 || moneys1 > 100) return SendClientMessage(playerid, COLOR_RED, "Invalid amount! Select from 0 - 100.");
- GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- SetPlayerHealth(giveplayerid, float(moneys1));
- if (giveplayerid != playerid)
- {
- format(string, 128, "Your health has been set to %d by an admin.", moneys1);
- SendClientMessage(giveplayerid, COLOR_SILVER, string);
- format(string, 128, "Your have set %s's health to %d.", giveplayer, moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- else
- {
- format(string, 128, "You have set your health to %d.", moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- /*if (PlayerInfo[playerid][pAdmin] < 3)
- {
- format(string, 128, "Admin Log: %s has set player %s's (Id%d) health to %d.", playername, giveplayer, giveplayerid, moneys1);
- SendMessageToAdmins(COLOR_ADMIN, string);
- }
- printf("[sethealth] %s has set player %s's (Id%d) health to %d.", playername, giveplayer, giveplayerid, moneys1);
- new str[256];
- format(str, sizeof(str), "%s has set player %s's (Id%d) health to %d.\r\n", playername, giveplayer, giveplayerid, moneys1);
- new File: file = fopen("Alog.cfg", io_append);
- fwrite(file, str);
- fclose(file);*/
- return 1;
- }
- CMD:setarmour(playerid, params[])
- {
- new giveplayerid, moneys1, giveplayer[25], playername[25], string[256];
- if (PlayerInfo[playerid][pAdmin] < 3) return 0;
- if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setarmor [playerid] [armor]");
- if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
- if (moneys1 < 0 || moneys1 > 100) return SendClientMessage(playerid, COLOR_RED, "Invalid amount! Select from 0 - 100.");
- GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- SetPlayerArmour(giveplayerid, float(moneys1));
- if (giveplayerid != playerid)
- {
- format(string, 128, "Your armor has been set to %d by an admin.", moneys1);
- SendClientMessage(giveplayerid, COLOR_SILVER, string);
- format(string, 128, "Your have set %s's armor to %d.", giveplayer, moneys1);
- SendClientMessage(playerid, COLOR_SILVER, string);
- }
- else
- {
- format(string, 128, "You have set your armor to %d.", moneys1);
- SendClientMessage(giveplayerid, COLOR_SILVER, string);
- }
- /*if (PlayerInfo[playerid][pAdmin] < 3)
- {
- format(string, 128, "Admin Log: %s has set player %s's (Id%d) armor to %d.", playername, giveplayer, giveplayerid, moneys1);
- SendMessageToAdmins(COLOR_ADMIN, string);
- }
- printf("[setarmor] %s has set player %s's (Id%d) armor to %d.", playername, giveplayer, giveplayerid, moneys1);
- new str[256];
- format(str, sizeof(str), "%s has set player %s's (Id%d) armour to %d.\r\n", playername, giveplayer, giveplayerid, moneys1);
- new File: file = fopen("Alog.cfg", io_append);
- fwrite(file, str);
- fclose(file);*/
- return 1;
- }
- CMD:clear(playerid,params[])
- {
- if( PlayerInfo[ playerid ][ pAdmin ] < 1 ) return SendClientMessage( playerid, COLOR_RED, "ERROR: You must be level 1 to use this command!" );
- {
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( COLOR_WHITE, "The chat has been cleared by an admin." );
- }
- return 1;
- }
- CMD:restart(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 7) return 0;
- new str[256], reson[256];
- if (sscanf(params, "s", reson)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /restart [reason]");
- format(str, sizeof(str), "*The server has been restarted, Reason: %s.", reson);
- SendClientMessageToAll(COLOR_RED, str);
- SetTimer("Restart", 500, 0);
- return 1;
- }
- CMD:v(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return 0;
- if(IsNumeric(params))
- {
- if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, -1, "usage: /veh <name/modelid>.");
- if(params[0] < 400 || params[0] > 611) return SendClientMessage(playerid, -1, "modelid invalid, usage: /veh <modelid 400-611>.");
- CreateVehicleEx(playerid, params[0]);
- }
- else
- {
- new name_vehicle[30], i_create_vehicle;
- if(sscanf(params, "s[30]", name_vehicle)) return SendClientMessage(playerid, -1, "usage: /veh <name/modelid>.");
- i_create_vehicle = GetModelVehicle(name_vehicle);
- if(i_create_vehicle < 400 || i_create_vehicle > 611) return SendClientMessage(playerid, -1, "name invalid, usage: /veh <name correct>.");
- CreateVehicleEx(playerid, i_create_vehicle);
- }
- return true;
- }
- CMD:gotopos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 7) return 0;
- new Float:x, Float:y, Float:z, interior;
- if(sscanf(params, "fffd", x, y, z, interior)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /gotopos <x> <y> <z> <interior>");
- SetPlayerInterior(playerid, interior);
- SetPlayerPos(playerid, x, y, z);
- return 1;
- }
- CMD:pos(playerid, params[])
- {
- new string[256];
- if (PlayerInfo[playerid][pAdmin] < 7) return 0;
- new Float:x, Float:y, Float:z, Float:a;
- if (!IsPlayerInAnyVehicle(playerid))
- {
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- }
- else
- {
- GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- format(string, 128, "X: %.3f, Y: %.3f, Z: %.3f, A: %.1f", x, y, z, a);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- CMD:ac(playerid, params[])
- {
- new string[172];
- if(PlayerInfo[playerid][pAdmin] < 1) return 0;
- if(isnull(params)) return SendClientMessage(playerid, -1, "Please use /ac [Message]");
- new PName[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, PName, sizeof(PName));
- format(string, sizeof(string), "AdminsChat %s: %s", PName, params);
- SendMessageToAdmins(COLOR_RED, string);
- return 1;
- }
- CMD:asay(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return 0;
- new text[128];
- if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /asay [text]");
- new string[128];
- new pName[128];
- GetPlayerName(playerid,pName,128);
- format(string,sizeof string,"[ADMIN]%s: %s",pName,text);
- SendClientMessageToAll(COLOR_GREEN,string);
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_BLUE, "Online Admins");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- new string[128], pname[24];
- GetPlayerName(i, pname, sizeof(pname));
- format(string, sizeof(string), "%s {FFFFFF} Level: %d (ID:%d)", pname, PlayerInfo[i][pAdmin], i);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- return 1;
- }
- CMD:weapons(playerid, params[])
- {
- {
- ShowPlayerDialog(playerid, WEAPON_SHOP, DIALOG_STYLE_LIST, "Weapons Packages", "{008800}Package 1 {FF0000} Price : $10000\n{008800}Package 2 {FF0000} Price : $11000", "Select", "Exit");
- return 1;
- }
- }
- /*CMD:playsong(playerid, params[])
- {
- new options[128];
- if(sscanf(params, "s[128]",options))
- {
- SendClientMessage(playerid, COLOR_WHITE, "Usage: /playsong [Wine Or Beer]");
- SendClientMessage(playerid, COLOR_SILVER, "{00FF00}Despacito, Closer");
- return 1;
- }
- else if(!strcmp(options, "Despacito", true, 5))
- {
- PlayAudioStreamForPlayer(playerid, "https://www.youtube.com/watch?v=kJQP7kiw5Fk");
- SendClientMessage(playerid, COLOR_WHITE, "Despacito Song has been started");
- }
- else if(!strcmp(options, "Closer", true, 5))
- {
- PlayAudioStreamForPlayer(playerid, "https://www.youtube.com/watch?v=PT2_F-1esPk");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Closer Song has been started");
- }
- else SendClientMessage(playerid, COLOR_RED, "Invalid Option.");
- return 1;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement