Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // //DM Script by Escobar //
- // // Made: 06/10/2017 //
- // // Version: 1.0 //
- #include <a_samp>
- #include <YSI\y_ini>
- #include <streamer>
- #include <sscanf2>
- #include <zcmd>
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- #define STATS 5
- #define STATS1 6
- #define NETSTATS 7
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- #define COLOR_RED 0xFF0000FF
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define PATH "/Users/%s.ini"
- enum pInfo
- {
- pPass,
- pCash,
- pKills,
- pDeaths,
- pAdmin,
- pMuted,
- pMuteTime,
- pScore,
- pSkin
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new unmute[MAX_PLAYERS];
- new Arena1[MAX_PLAYERS];
- new Arena2[MAX_PLAYERS];
- new Arena3[MAX_PLAYERS];
- new Arena4[MAX_PLAYERS];
- new Arena5[MAX_PLAYERS];
- forward UnMuteMe(playerid);
- public UnMuteMe(playerid)
- {
- PlayerInfo[playerid][pMuted] = 0;
- PlayerInfo[playerid][pMuteTime] = 0;
- SendClientMessage(playerid, COLOR_ORANGE,"You have been 'Un-Muted'");
- return 1;
- }
- 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("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Score",PlayerInfo[playerid][pScore]);
- INI_Int("Skin",PlayerInfo[playerid][pSkin]);
- return 1;
- }
- stock IsValidWeapon(weaponid)
- {
- if (weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47 || weaponid != 38 || weaponid != 44 || weaponid != 45 || weaponid != 36) return 1;
- return 0;
- }
- stock MessageToAdmins(color, const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- stock SendAdminMessage(col, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pAdmin] > 0)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock TargetCMDMessage(playerid, target, command[])
- {
- new name[MAX_PLAYER_NAME], name1[MAX_PLAYER_NAME];
- GetPlayerName(target, name, sizeof(name));
- GetPlayerName(playerid, name1, sizeof(name1));
- new string[128];
- format(string, sizeof(string),"[ADM.CMD] Administrator %s[%i] has used %s on %s[%i]", name1, playerid, command, name, target);
- return MessageToAdmins(-1, string);
- }
- stock CMDMessage(playerid, command[])
- {
- new name1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name1, sizeof(name1));
- new string[128];
- format(string, sizeof(string),"[ADM.CMD] Administrator %s[%i] has used %s", name1, playerid, command);
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- stock PlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- return name;
- }
- /*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;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Escobar's DM");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("DM");
- AddPlayerClass(1, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- CreateDynamicCP(2244.5698,1683.6130,1008.3594, 3.0, 0, 1, -1,STREAMER_CP_SD, -1, 0);
- CreateDynamicCP(2246.6040,1677.1489,1008.3594, 3.0, 0, 1, -1,STREAMER_CP_SD, -1, 0);
- CreateDynamicCP(2244.2239,1670.4600,1008.3594, 3.0, 0, 1, -1,STREAMER_CP_SD, -1, 0);
- CreateDynamicCP(2227.2551,1670.5055,1008.3594, 3.0, 0, 1, -1,STREAMER_CP_SD, -1, 0);
- CreateDynamicCP(2226.5605,1683.2289,1008.3594, 3.0, 0, 1, -1,STREAMER_CP_SD, -1, 0);
- AddStaticPickup(1242,3,2543.1226,-1321.0045,1031.4219,-1); // Armo
- AddStaticPickup(1242,3,259.0793,1811.0322,22.9922,-1); // Armor
- AddStaticPickup(1242,3,-335.0574,2220.2739,42.4875,-1); //Armor
- AddStaticPickup(1242,3,276.6747,170.8388,1007.6719,-1); //Armo
- AddStaticPickup(1242,3,1245.1157,-776.1143,1084.0078,-1);//Armor
- AddStaticPickup(1240,3,2535.1021,-1320.8042,1031.4219,-1); //Health
- AddStaticPickup(1240,3,207.3327,1922.1807,17.6406,-1);
- AddStaticPickup(1240,3,-398.5371,2251.3950,42.4297,-1);
- AddStaticPickup(1240,3,232.8155,163.3023,1003.0234,-1);
- AddStaticPickup(1240,3,1258.9954,-795.6130,1084.2344,-1); //Health
- AddStaticPickup(356,3,2526.8696,-1321.2657,1031.4219,-1); //M4
- AddStaticPickup(356,3,260.6836,1806.0990,33.8984,-1);
- AddStaticPickup(356,3,-430.0052,2240.8186,42.9834,-1);
- AddStaticPickup(356,3,190.6796,158.2805,1003.0234,-1);
- AddStaticPickup(356,3,1258.4299,-804.4128,1084.0078,-1); //M4
- AddStaticPickup(355,3,2567.0015,-1289.0721,1037.7734,-1);
- AddStaticPickup(355,3,161.6969,1930.5021,33.8984,-1);
- AddStaticPickup(355,3,-456.5122,2225.3232,42.9581,-1);
- AddStaticPickup(355,3,190.9721,179.1932,1003.0234,-1);
- AddStaticPickup(355,3,1228.4976,-808.2664,1084.0078,-1);
- Create3DTextLabel("Ghost Town", 0xF70AF7, 2244.5698,1683.6130,1008.3594, 40.0, 0, 0);
- Create3DTextLabel("LVPD Interior", 0xF70AF7, 2246.6040,1677.1489,1008.3594, 40.0, 0, 0);
- Create3DTextLabel("Mad Doggs Mansion", 0xF70AF7, 2244.2239,1670.4600,1008.3594, 40.0, 0, 0);
- Create3DTextLabel("Area 69", 0xF70AF7, 2227.2551,1670.5055,1008.3594, 40.0, 0, 0);
- Create3DTextLabel("Drug Den", 0xF70AF7, 2226.5605,1683.2289,1008.3594, 40.0, 0, 0);
- DisableInteriorEnterExits();
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerInterior(playerid,11);
- SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
- SetPlayerFacingAngle(playerid,0.0);
- SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
- SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new Pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Pname, sizeof(Pname));
- new str[100];
- format(str,sizeof(str),"%s has joined the 'Server Name'",Pname);
- SendClientMessageToAll(-1,str);
- Arena1[playerid] = 0;
- Arena2[playerid] = 0;
- Arena3[playerid] = 0;
- Arena4[playerid] = 0;
- Arena5[playerid] = 0;
- 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");
- SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
- SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
- PlayerInfo[playerid][pCash] = 0;
- PlayerInfo[playerid][pKills] = 0;
- PlayerInfo[playerid][pDeaths] = 0;
- PlayerInfo[playerid][pAdmin] = 0;
- PlayerInfo[playerid][pScore] = 0;
- PlayerInfo[playerid][pSkin] = 1;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Score",GetPlayerScore(playerid));
- INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- {
- SetPlayerInterior(playerid,1);
- SetPlayerPos(playerid,2236.1191,1678.5986,1008.3594);
- }
- if(Arena1[playerid] == 1)
- {
- GetPlayerSkin(playerid);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-373.5241,2199.6157,42.0893);
- GivePlayerWeapon(playerid,24,500);
- SetPlayerSkin(playerid,GetPlayerSkin(playerid));
- }
- if(Arena2[playerid] == 1)
- {
- GetPlayerSkin(playerid);
- SetPlayerInterior(playerid,3);
- SetPlayerPos(playerid,297.0647,182.9002,1007.1719);
- GivePlayerWeapon(playerid,24,500);
- SetPlayerSkin(playerid,GetPlayerSkin(playerid));
- }
- if(Arena3[playerid] == 1)
- {
- GetPlayerSkin(playerid);
- SetPlayerInterior(playerid,5);
- SetPlayerPos(playerid,1290.6121,-774.6445,1084.0078);
- GivePlayerWeapon(playerid,24,500);
- SetPlayerSkin(playerid,GetPlayerSkin(playerid));
- }
- if(Arena4[playerid] == 1)
- {
- GetPlayerSkin(playerid);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,211.5686,1811.4602,21.8594);
- GivePlayerWeapon(playerid,24,500);
- SetPlayerSkin(playerid,GetPlayerSkin(playerid));
- }
- if(Arena5[playerid] == 1)
- {
- GetPlayerSkin(playerid);
- SetPlayerInterior(playerid,2);
- SetPlayerPos(playerid,2543.462646,-1308.379882,1026.728393);
- GivePlayerWeapon(playerid,24,500);
- SetPlayerSkin(playerid,GetPlayerSkin(playerid));
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendDeathMessage(killerid, playerid, 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"Registering...",""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,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Score",0);
- INI_WriteInt(File,"Skin",1);
- INI_Close(File);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Thanks! You are registered at, "COL_LIGHTBLUE"YOUR_SERVER","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]);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid==1)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-373.5241,2199.6157,42.0893);
- GivePlayerWeapon(playerid,24,500);
- SendClientMessage(playerid,-1,"Welcome to Ghost Town playa.");
- SetPlayerColor(playerid,0xFF00FF);
- Arena1[playerid] = 1;
- }
- if(checkpointid==2)
- {
- SetPlayerInterior(playerid,3);
- SetPlayerPos(playerid,297.0647,182.9002,1007.1719);
- GivePlayerWeapon(playerid,24,500);
- SendClientMessage(playerid,-1,"Welcome to LV Police Station playa.");
- SetPlayerColor(playerid,0xFF0066);
- Arena2[playerid] = 1;
- }
- if(checkpointid==3)
- {
- SetPlayerInterior(playerid,5);
- SetPlayerPos(playerid,1290.6121,-774.6445,1084.0078);
- GivePlayerWeapon(playerid,24,500);
- SendClientMessage(playerid,-1,"Welcome to Mad Doggs playa.");
- SetPlayerColor(playerid,0x6600FF);
- Arena3[playerid] = 1;
- }
- if(checkpointid==4)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,211.5686,1811.4602,21.8594);
- GivePlayerWeapon(playerid,24,500);
- SendClientMessage(playerid,-1,"Welcome to Area 69 playa.");
- SetPlayerColor(playerid,0xFF55FF);
- Arena4[playerid] = 1;
- }
- if(checkpointid==5)
- {
- SetPlayerInterior(playerid,2);
- SetPlayerPos(playerid,2543.462646,-1308.379882,1026.728393);
- GivePlayerWeapon(playerid,24,500);
- SendClientMessage(playerid,-1,"Welcome to Drug Den playa.");
- SetPlayerColor(playerid,0xBBFFFF);
- Arena5[playerid] = 1;
- }
- return 1;
- }
- ///////////////////////////////////////////////////////////////////////////////
- CMD:cmds(playerid,params[])
- {
- SendClientMessage(playerid,-1,"General Commands: /lobby /cmds /rules /help /mystats /stats /skin /admins");
- SendClientMessage(playerid,-1,"General Commands: /pm /server /kill /report /mynetstats");
- return 1;
- }
- CMD:acmds(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Admin Commands: /getip /ban /kick /mute /unmute /giveallweapon /giveallcash");
- SendClientMessage(playerid,COLOR_ORANGE,"Admin Commands: /giveallscore /healall /armorall /sethealth /giveweapon");
- SendClientMessage(playerid,COLOR_ORANGE,"Admin Commands: /explode /freeze /unfreeze /goto /get /aduty /aoffduty /(a)chat");
- } else return SendClientMessage(playerid,-1,"SERVER:Unknown command");
- return 1;
- }
- CMD:lobby(playerid,params[])
- {
- SetPlayerInterior(playerid,1);
- SetPlayerPos(playerid,2236.1191,1678.5986,1008.3594);
- ResetPlayerWeapons(playerid);
- Arena1[playerid] = 0;
- Arena2[playerid] = 0;
- Arena3[playerid] = 0;
- Arena4[playerid] = 0;
- Arena5[playerid] = 0;
- return 1;
- }
- CMD:rules(playerid,params[])
- {
- SendClientMessage(playerid,-1,"1.This is a DM Server.");
- SendClientMessage(playerid,-1,"2. Don't use any kind of cheats, you will get banned.");
- return 1;
- }
- CMD:help(playerid,params[])
- {
- SendClientMessage(playerid,-1,"Use /cmds to get to know this script features.");
- return 1;
- }
- CMD:setadmin(playerid,params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"SERVER: Unknown command.");
- new id, level, str1[100], str[100];
- if(sscanf(params,"ui",id,level)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /setadmin [ID] [Level]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"ERROR: That player is not connnected.");
- if( level < 0 || level > 4) return SendClientMessage(playerid,COLOR_RED,"Level 4 is the highest admin level.");
- format(str,sizeof(str),"You've been set admin level %d by an administrator.",level);
- format(str1,sizeof(str1),"You've set that player admin level %d.",level);
- SendClientMessage(id,-1,str);
- SendClientMessage(playerid,-1,str1);
- PlayerInfo[id][pAdmin] = level;
- return 1;
- }
- CMD:mystats(playerid,params[])
- {
- if(IsPlayerConnected(playerid))
- {
- new string[128], stats[1024];
- format(string,sizeof(string),"Cash: %d \n Kills: %d \n Deaths: %d \n Admin: %d",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
- format(stats, sizeof stats, "%s", string);
- ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Account Info:",stats,"Ok","");
- }
- return 1;
- }
- CMD:stats(playerid,params[])
- {
- new id, str[128], stats[500];
- if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /stats [id]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"ERROR: That player is not connected");
- if(id == playerid) return SendClientMessage(playerid,COLOR_RED,"Why don't you use /mystats better?");
- format(str,sizeof(str),"Cash: %d \n Kills: %d \n Deaths: %d \n Admin: %d",PlayerInfo[id][pCash],PlayerInfo[id][pKills],PlayerInfo[id][pDeaths],PlayerInfo[id][pAdmin]);
- format(stats, sizeof stats, "%s", str);
- ShowPlayerDialog(playerid,STATS1,DIALOG_STYLE_MSGBOX,"Account Info:",stats,"Ok","");
- return 1;
- }
- CMD:skin(playerid, params[])
- {
- new skin, str[150];
- if(sscanf(params, "i", skin)) return SendClientMessage(playerid, COLOR_RED, "[SX-USAGE] {B0B0B0}Β»{FFFF00} /skin <0 - 299>");
- if(skin < 1 || skin > 299) return SendClientMessage(playerid, COLOR_RED, "[SX-USAGE] {B0B0B0}Β»{FFFF00} Invalid SkinID! < 0 - 299 >");
- if(skin == 74) return SendClientMessage(playerid,COLOR_RED,"Sorry, but you can't use this skin.");
- SetPlayerSkin(playerid, skin);
- format(str, sizeof(str), "[INFO] {FFFFFF}Your skin has been changed to Skin ID: %i", skin);
- SendClientMessage(playerid, COLOR_ORANGE, str);
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- new count = 0, string[256];
- SendClientMessage(playerid, COLOR_ORANGE,"Online Administrators at the moment:");
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- format(string, sizeof(string),"Admin ID:[%d] %s Level: %d", i, PlayerName(i), PlayerInfo[i][pAdmin]);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- count++;
- }
- }
- }
- if(count == 0)
- {
- SendClientMessage(playerid, COLOR_RED,"No admins are online right now!");
- }
- return 1;
- }
- COMMAND:pm(playerid, params[])
- {
- new id, string[128], string2[128], sender[MAX_PLAYER_NAME], reciever[MAX_PLAYER_NAME];
- if(sscanf(params, "us[75]", id, params[2])) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /pm [id] [message]");
- GetPlayerName(playerid, sender, sizeof(sender));
- GetPlayerName(id, reciever, sizeof(reciever));
- format(string, sizeof(string), "PM recieved from %s: %s", sender, params[2]);
- format(string2, sizeof(string2), "PM sent to %s: %s", reciever, params[2]);
- SendClientMessage(id, 0xFFFFFFFF, string);
- SendClientMessage(playerid, 0xFFFFFFFF, string2);
- return 1;
- }
- CMD:getip(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >=1)
- {
- new targetid, ip[16], string[60];
- if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /getip [ID].");
- GetPlayerIp(targetid,ip,sizeof(ip));
- format(string, sizeof(string), "[SERVER]:TargetID IP is: %s ",ip);
- SendClientMessage(playerid,COLOR_ORANGE,string);
- }
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >=2)
- {
- new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
- if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason(optional)]");
- GetPlayerName(id, banned, sizeof(banned));
- format(string, sizeof(string), "AdmCmd: %s has been banned by %s. reason: %s", banned, PlayerName(playerid), reason);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(id, reason);
- }
- return 1;
- }
- CMD:kick(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >=1)
- {
- new id,gname[MAX_PLAYER_NAME],string[125],reason[70];
- if(sscanf(params,"us[70]",id,reason)) return SendClientMessage(playerid,-1," (ERROR) : /kick [playerid] [reason]");
- if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid,-1," (ERROR) : The id you have typed is invalid!");
- GetPlayerName(id,gname,sizeof(gname));
- format(string, sizeof(string), "SERVER: %s has been kicked from the server Reason: %s", gname,reason);
- SendClientMessageToAll( -1, string);
- Kick(id);
- }
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new player1, time, str[123], reason[30];
- if(sscanf(params,"dds[30]", player1, time)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /mute [playerid] [time (counted in minutes)] [reason]");
- if(IsPlayerConnected(player1))
- {
- if(PlayerInfo[player1][pMuted] == 0)
- {
- PlayerInfo[player1][pMuted] = 1;
- PlayerInfo[player1][pMuteTime] = time*60000;
- format(str, sizeof(str),"Administrator %s has muted %s for %i minutes [Reason: %s]", PlayerName(playerid), PlayerName(player1), time, reason);
- SendClientMessageToAll(COLOR_ORANGE, str);
- unmute[player1] = SetTimerEx("UnMuteMe", PlayerInfo[player1][pMuteTime], false, "d", playerid);
- TargetCMDMessage(playerid, player1,"MUTE");
- }
- else return SendClientMessage(playerid, COLOR_RED,"Player is already muted!");
- }
- else return SendClientMessage(playerid, COLOR_RED,"Player is not connected!");
- }
- else return SendClientMessage(playerid, COLOR_RED,"SERVER: Unknown command!");
- return 1;
- }
- CMD:unmute(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new player1, str[123];
- if(sscanf(params,"d", player1)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /unmute [playerid]");
- if(IsPlayerConnected(player1))
- {
- if(PlayerInfo[player1][pMuted] == 1)
- {
- PlayerInfo[player1][pMuted] = 0;
- PlayerInfo[player1][pMuteTime] = 0;
- format(str, sizeof(str),"Administrator %s has unmuted %s", PlayerName(playerid), PlayerName(player1));
- SendClientMessageToAll(COLOR_ORANGE, str);
- TargetCMDMessage(playerid, player1,"UNMUTE");
- KillTimer(unmute[player1]);
- }
- else return SendClientMessage(playerid, COLOR_RED,"Player is not muted!");
- }
- else return SendClientMessage(playerid, COLOR_RED,"Player is not connected!");
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- return 1;
- }
- CMD:server(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Server Name: 'Name'");
- SendClientMessage(playerid,COLOR_ORANGE,"Server IP: IP");
- SendClientMessage(playerid,COLOR_ORANGE,"Server Forums: url");
- SendClientMessage(playerid,COLOR_ORANGE,"Discord Server: IP");
- return 1;
- }
- CMD:kill(playerid,params[])
- {
- new Float:health;
- GetPlayerHealth(playerid,health);
- if (health < 50.0) return SendClientMessage(playerid,COLOR_RED,"You can't use this command.");
- SetPlayerHealth(playerid,0.0);
- SendClientMessage(playerid,COLOR_RED,"You've killed yourself.");
- return 1;
- }
- CMD:giveallweapon(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- new weapid, ammo;
- if(sscanf(params,"dd", weapid, ammo)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /giveallweapon [weapon] [ammo]");
- if(IsValidWeapon(weapid))
- {
- if(IsPlayerConnected(i))
- {
- GivePlayerWeapon(i, weapid, ammo);
- new str[150];
- format(str, sizeof(str),"Administrator %s has given everyone %d ammo of weapon %d", PlayerName(playerid), ammo, weapid);
- SendClientMessage(i, COLOR_ORANGE, str);
- }
- }
- else return SendClientMessage(playerid, COLOR_RED,"You are not allowed to give this weapon!");
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- }
- return 1;
- }
- CMD:giveallcash(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- new ammount;
- if(sscanf(params,"d", ammount)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /giveallcash [ammount]");
- if(IsPlayerConnected(i))
- {
- GivePlayerMoney(i, ammount);
- new str[150];
- format(str, sizeof(str),"Administrator %s has given everyone $%d money", PlayerName(playerid), ammount);
- SendClientMessage(i, COLOR_ORANGE, str);
- }
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- }
- return 1;
- }
- CMD:giveallscore(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- new ammount;
- if(sscanf(params,"d", ammount)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /giveallscore [ammount]");
- if(IsPlayerConnected(i))
- {
- SetPlayerScore(i, GetPlayerScore(i)+ammount);
- new str[150];
- format(str, sizeof(str),"Administrator %s has given everyone %d score(s)", PlayerName(playerid), ammount);
- SendClientMessage(i, COLOR_ORANGE, str);
- }
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- }
- return 1;
- }
- CMD:healall(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- for(new i =0; i < MAX_PLAYERS; i ++ )
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerHealth(i, 100.0);
- new str[100];
- format(str, sizeof(str),"Administrator %s has healed all players!", PlayerName(playerid));
- SendClientMessage(i, COLOR_ORANGE, str);
- CMDMessage(playerid,"HEALALL");
- }
- }
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- return 1;
- }
- CMD:armorall(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- for(new i =0; i < MAX_PLAYERS; i ++ )
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerArmour(i, 100.0);
- new str[100];
- format(str, sizeof(str),"Administrator %s has armoured all players!", PlayerName(playerid));
- SendClientMessage(i, COLOR_ORANGE, str);
- CMDMessage(playerid,"ARMOURALL");
- }
- }
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new player1, str[120], amount;
- if(sscanf(params,"dd", player1, amount)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /sethealth [playerid] [health]");
- if(IsPlayerConnected(player1))
- {
- SetPlayerHealth(player1, amount);
- format(str, sizeof(str),"You have setted %s's health to %d", PlayerName(player1), amount);
- SendClientMessage(playerid, COLOR_ORANGE, str);
- TargetCMDMessage(playerid, player1,"SETHEALTH");
- }
- else return SendClientMessage(playerid, COLOR_RED,"Player is not connected!");
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- return 1;
- }
- CMD:giveweapon(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new target, weapid, ammo;
- if(sscanf(params,"ddd", target, weapid, ammo)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /giveweapon [playerid] [weapon] [ammo]");
- if(IsValidWeapon(weapid))
- {
- if(IsPlayerConnected(target))
- {
- GivePlayerWeapon(target, weapid, ammo);
- new str[150];
- format(str, sizeof(str),"Administrator %s has given you %d ammo of weapon %d", PlayerName(playerid), ammo, weapid);
- SendClientMessage(target, COLOR_ORANGE, str);
- TargetCMDMessage(playerid, target,"GIVEWEAPON");
- }
- else return SendClientMessage(playerid, COLOR_RED,"Player is not connected!");
- }
- else return SendClientMessage(playerid, COLOR_RED,"You are not allowed to give this weapon!");
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- return 1;
- }
- CMD:explode(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new player1, Float:x, Float:y, Float:z, str[70];
- if(sscanf(params,"d", player1)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /explode [playerid] ");
- if(IsPlayerConnected(player1))
- {
- GetPlayerPos(player1, x, y, z);
- CreateExplosion(x, y, z, 7, 10.0);
- format(str, sizeof(str),"You have exploded %s!", PlayerName(player1));
- SendClientMessage(playerid, COLOR_RED, str);
- TargetCMDMessage(playerid, player1,"EXPLODE");
- }
- else return SendClientMessage(playerid, COLOR_RED,"That player is not connected!");
- }
- else return SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- return 1;
- }
- CMD:freeze(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new id;
- if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /freeze [ID]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"That player is not connected");
- new str[100];
- format(str,sizeof (str),"You have been frozen by an admin.", id);
- SendClientMessage(id, COLOR_RED, str);
- TogglePlayerControllable(id,0);
- }
- return 1;
- }
- CMD:unfreeze(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new id;
- if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /unfreeze [ID]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"That player is not connected");
- new str[100];
- format(str,sizeof(str),"You have been unfrozen by an admin.",id);
- SendClientMessage(id,COLOR_RED,str);
- TogglePlayerControllable(id,1);
- }
- return 1;
- }
- CMD:mynetstats(playerid,params[])
- {
- new stats[400+1];
- GetPlayerNetworkStats(playerid, stats, sizeof(stats)); // get your own networkstats
- ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "My NetworkStats", stats, "Okay", "");
- return 1;
- }
- CMD:achat(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new text[150];
- if(sscanf(params, "s[150]",text)) return SendClientMessage(playerid, COLOR_RED, "/(a)chat [text]");
- format(text, sizeof(text), "[Admin]%s: %s",PlayerName(playerid), text);
- SendAdminMessage(COLOR_ORANGE, text);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE,"SERVER: Unknown command!");
- }
- return 1;
- }
- CMD:a(playerid, params[]) return cmd_achat(playerid, params);
- CMD:aduty(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new str[100];
- SetPlayerColor(playerid,0xFFD700);
- SetPlayerHealth(playerid,999999999.9);
- format(str,sizeof(str),"%s is now on admin duty.",PlayerName(playerid));
- SendClientMessageToAll(COLOR_ORANGE,str);
- }
- return 1;
- }
- CMD:aoffduty(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SetPlayerColor(playerid,-1);
- SetPlayerHealth(playerid,100.0);
- }
- return 1;
- }
- CMD:report(playerid, params[])
- {
- new player1, str[150], reason[66];
- if(sscanf(params,"ds[66]", player1, reason)) return SendClientMessage(playerid, COLOR_RED,"[USAGE]: /report [playerid] [reason]");
- if(IsPlayerConnected(player1))
- {
- format(str, sizeof(str),"@New Report| Reporter: %s | Victim: %s | Reason: %s", PlayerName(playerid), PlayerName(player1), reason);
- MessageToAdmins(COLOR_ORANGE, str);
- SendClientMessage(playerid, COLOR_ORANGE,"Your report has been sent to online administrators!");
- }
- else return SendClientMessage(playerid, COLOR_RED,"That player is not connected!");
- return 1;
- }
- CMD:goto(playerid, params[])
- {
- new playerb;
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- if(sscanf(params, "u", playerb)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /goto [playerid]");
- if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,COLOR_RED,"That player is not connected.");
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerb, x, y, z);
- SetPlayerPos(playerid, x+1, y+1, z);
- }
- return 1;
- }
- CMD:get(playerid, params[])
- {
- new playerb;
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- if(sscanf(params, "u", playerb)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /get [playerid]");
- if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,COLOR_RED,"That player is not connected.");
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(playerb, x+1, y+1, z);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement