SHE790

ShAdmin

Jul 2nd, 2014
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 49.84 KB | None | 0 0
  1.  
  2. #include <a_samp>
  3. #include <dini>
  4. #include <foreach>
  5. #include <sscanf2>
  6. #include <YSI/y_ini>
  7. #include <YSI\y_commands>
  8. #define COLOR_RED 0xE01B4CFF
  9. #define COL_BLUE "{345ACF}"
  10. #define COL_RED "{E01B4C}"
  11. #define COL_WHITE "{FFFFFF}"
  12. #define COL_ORA "{E0A21B}"
  13. #define COL_YELLOW "{F5E618}"
  14. #define COL_GREEN "{2EAD15}"
  15. #define IPI INVALID_PLAYER_ID
  16. #define SCM SendClientMessage
  17. #define SCMToAll SendClientMessageToAll
  18. #define DIALOG_REGISTER 1
  19. #define DIALOG_LOGIN    2
  20. #define DIALOG_CLICK    3
  21. #define DIALOG_ADMIN    4
  22. #define RCON_DIALOG     5
  23. #define SKIN_ID 150
  24. #define START_MONEY 1000
  25. #define INI_Exists(%0)  fexist(%0)
  26. #define MAX_PING 500
  27. #define PING_KICK 2000//u can change the 2000 its the max ping
  28. #define MAX_CARS  1000//max cars
  29. #define Player_File "Players/%s.ini"
  30. #pragma tabsize 0
  31.  
  32. new Text:Spec0[MAX_PLAYERS];
  33. new Text:Spec1[MAX_PLAYERS];
  34. new
  35.     countd = -1,
  36.     countdown,
  37.     cdstarted = 0;
  38.  
  39. forward LoadPlayerData(playerid, name[], value[]);
  40.  
  41. enum pData
  42. {
  43.     pPassword,
  44.     pAdmin,
  45.     pMoney,
  46.     pScore,
  47.     pMute,
  48.     pFrozen,
  49.     pSpecating,
  50.     pSkin,
  51.     pWarn,
  52.     pSpam,
  53.     pDuty,
  54.     VIP,
  55. }
  56. new P_Data[MAX_PLAYERS][pData];
  57. new SwearWords[][] = //add ur own swer words
  58. {
  59.   "noob",
  60.   "s0beit",
  61.   "fuck u",
  62.   "mother fucker",
  63.   "dick",
  64.   "suck",
  65.   "ass",
  66.   "fuck"
  67. };
  68. public OnFilterScriptInit()
  69. {
  70.     UsePlayerPedAnims();
  71.     SetTimer("PingKicker", PING_KICK, true);
  72.     AddPlayerClass(SKIN_ID, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  73.     SetTimer("ClearSpam",5000,true);
  74.     for(new playerid = 0;playerid < GetMaxPlayers();playerid++) {
  75.     Spec0[playerid] = TextDrawCreate(322.000000, 322.000000, "~h~~g~Specating");
  76.     TextDrawBackgroundColor(Spec0[playerid], 255);
  77.     TextDrawFont(Spec0[playerid], 2);
  78.     TextDrawLetterSize(Spec0[playerid], 0.370000, 2.900000);
  79.     TextDrawColor(Spec0[playerid], 16711935);
  80.     TextDrawSetOutline(Spec0[playerid], 1);
  81.     TextDrawSetProportional(Spec0[playerid], 0);
  82.  
  83.     Spec1[playerid] = TextDrawCreate(211.000000, 360.000000, "~g~Name: ~w~She[R]vin.K ~g~Score: ~w~7    ~g~Money: ~w~101000");
  84.     TextDrawBackgroundColor(Spec1[playerid], 255);
  85.     TextDrawFont(Spec1[playerid], 3);
  86.     TextDrawLetterSize(Spec1[playerid], 0.360000, 1.299998);
  87.     TextDrawColor(Spec1[playerid], -1);
  88.     TextDrawSetOutline(Spec1[playerid], 0);
  89.     TextDrawSetProportional(Spec1[playerid], 1);
  90.     TextDrawSetShadow(Spec1[playerid], 1); }
  91.     print("\n--------------------------------------");
  92.     print(" Admin System Scripted By She[R]vin.K");
  93.     print("--------------------------------------\n");
  94.  
  95.         return 1;
  96. }
  97.  
  98.  
  99. public OnFilterScriptExit()
  100. {
  101.     return 1;
  102. }
  103.  
  104.  
  105. main()
  106. {
  107.     print("\n----------------------------------");
  108.     print("  Admin System Scripted By She[R]vin.K");
  109.     print("----------------------------------\n");
  110. }
  111.  
  112.  
  113. public OnPlayerRequestClass(playerid, classid)
  114. {
  115.     SetPlayerPos(playerid, 768.4396,-1373.0276,13.5605);
  116.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  117.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  118.     SetPVarInt(playerid, "Join", 1);
  119.     return 1;
  120. }
  121.  
  122. public OnPlayerConnect(playerid)
  123. {
  124.     new dialog[128], string[128];
  125.     format(string, 35, Player_File, GetName(playerid));
  126.  
  127.     if(!INI_Exists(string))
  128.     {
  129.         format(dialog, sizeof(dialog),""COL_BLUE"Name "COL_WHITE"%s "COL_YELLOW"isn't registered\n\nPlease typepassword", GetName(playerid));
  130.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Welcome to my server", dialog, "Register", "Exit");
  131.     }
  132.     else
  133.     {
  134.         format(dialog, sizeof(dialog),""COL_YELLOW"Name "COL_WHITE"%s "COL_YELLOW"is registered\n\nPlease login", GetName(playerid));
  135.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Welcome to my server",dialog, "Login", "Exit");
  136.     }
  137.     SetPVarInt(playerid, "Join", 1);
  138.     new Pname[MAX_PLAYER_NAME];
  139.         GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
  140.        
  141.         return 1;
  142. }
  143.  
  144.  
  145. public OnPlayerDisconnect(playerid, reason)
  146. {
  147.     new
  148.         pFile[35];
  149.  
  150.     format(pFile, 35, Player_File, GetName(playerid));
  151.    
  152.     new
  153.     INI:UserFile = INI_Open(pFile);
  154.     INI_WriteInt(UserFile, "Admin", P_Data[playerid][pAdmin]);
  155.     INI_WriteInt(UserFile, "Money", GetPlayerMoney(playerid));
  156.     INI_WriteInt(UserFile, "Score", GetPlayerScore(playerid));
  157.     INI_WriteInt(UserFile, "Skin", P_Data[playerid][pSkin]);
  158.     INI_WriteInt(UserFile, "Warn", P_Data[playerid][pWarn]);
  159.     INI_WriteInt(UserFile, "VIP", P_Data[playerid][VIP]);
  160.  
  161.     INI_Close(UserFile);
  162.     new Pname[MAX_PLAYER_NAME];
  163.         GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
  164.         return 1;
  165. }
  166.  
  167. public OnPlayerSpawn(playerid)
  168. {
  169. if(GetPVarInt(playerid, "Join") == 1)
  170.     {
  171.         GivePlayerMoney(playerid, P_Data[playerid][pMoney]);
  172.         SetPlayerScore(playerid, P_Data[playerid][pScore]);
  173.  
  174.         SetPVarInt(playerid, "Join", 0);
  175.         if(P_Data[playerid][pWarn] >= 5) {
  176.         Kick(playerid);
  177.         SCM(playerid,COLOR_RED,"You have 5 warns!");}
  178.     }
  179.         return 1;
  180. }
  181. public OnPlayerText(playerid, text[])
  182. {
  183.     if(P_Data[playerid][pMute] == 1) {
  184.     SCM(playerid, COLOR_RED, "You are muted!");
  185.     return 0; }
  186.     for(new words; words<sizeof(SwearWords); words++)
  187.     {
  188.       if(strfind(text,SwearWords[words],true) != -1 ) { SCM(playerid, COLOR_RED,"Behave"); return 0;}
  189.     }
  190.     P_Data[playerid][pSpam] += 1;
  191.     if(P_Data[playerid][pSpam] == 5) {
  192.         new string[128];
  193.         format(string, 128, "[ANTI-SPAM] Player %s has been kicked.", GetName(playerid));
  194.         SCMToAll(COLOR_RED,string);
  195.         Kick(playerid);
  196.     }
  197.     else if(P_Data[playerid][pSpam] == 4) {
  198.         SCM(playerid,COLOR_RED,"STOP SPAMMING OR U WILL GET AUTO KICKED!");
  199.         return 0;
  200.     }
  201.     return 1;
  202. }
  203.  
  204. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  205. {
  206. switch(dialogid)
  207.     {
  208.         case DIALOG_REGISTER:
  209.         {
  210.             if(response)
  211.             {
  212.                  new
  213.                     string[179],pFile[35];
  214.  
  215.                     format(pFile, 35, Player_File, GetName(playerid));
  216.  
  217.                  new
  218.                     INI:UserFile = INI_Open(pFile);
  219.  
  220.                     INI_WriteInt(UserFile, "Password", udb_hash(inputtext));
  221.                     INI_WriteInt(UserFile, "Admin", 0);
  222.                     INI_WriteInt(UserFile, "Money", START_MONEY);
  223.                     INI_WriteInt(UserFile, "Score", 0);
  224.                     INI_WriteInt(UserFile, "Skin", SKIN_ID);
  225.                     INI_WriteInt(UserFile, "Warn", 0);
  226.                     INI_WriteInt(UserFile, "VIP", 0);
  227.  
  228.                     INI_Close(UserFile);
  229.  
  230.                     SetPVarInt(playerid, "Registered", 1);
  231.                     SetPVarInt(playerid, "Logged", 1);
  232.                     SpawnPlayer(playerid);
  233.  
  234.                     format(string, 125, ""COL_YELLOW"Name: "COL_WHITE"%s "COL_YELLOW"Password: "COL_WHITE"%s "COL_YELLOW"succesfuly registerd", GetName(playerid), inputtext);
  235.                     SCM(playerid, 0x46BA29FF, string);
  236.                     SpawnPlayer(playerid);
  237.             }
  238.             else Kick(playerid);
  239.         }
  240.  
  241.         case DIALOG_LOGIN:
  242.         {
  243.             if(response)
  244.             {
  245.                     new
  246.                     pFile[35],dialog[128];
  247.  
  248.                     format(pFile, 35, Player_File, GetName(playerid));
  249.  
  250.                     INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);
  251.  
  252.  
  253.                     if(udb_hash(inputtext) == P_Data[playerid][pPassword])
  254.                     {
  255.                     SetPVarInt(playerid, "Logged", 1);
  256.                     SCM(playerid,-1,"Succesfuly login!");
  257.                     }
  258.                     else
  259.                     {
  260.                     format(dialog, sizeof(dialog),""COL_YELLOW"Name "COL_WHITE"%s "COL_YELLOW"is registered\n\n{FFFFFF}Please login", GetName(playerid));
  261.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FF0033}Welcome to my server",dialog, "Login", "Exit");
  262.                     }
  263.                 }
  264.             else Kick(playerid);
  265.         }
  266.         case DIALOG_CLICK:
  267.         {
  268.                 if(!response) return SCM(playerid,-1,"Dialog is closed");
  269.                 new
  270.                     text[128];
  271.                 switch(listitem)
  272.                 {
  273.                 case 0: {
  274.                 Kick(GetPVarInt(playerid,"pplayerid"));
  275.                 SetPVarInt(playerid,"pplayerid",999);
  276.                 format(text,sizeof(text),"Admin %s is kick you from server!",GetName(playerid));
  277.                 SCM(GetPVarInt(playerid,"pplayerid"),-1,text);}
  278.                 case 1: {
  279.                 Ban(GetPVarInt(playerid,"pplayerid"));
  280.                 SetPVarInt(playerid,"pplayerid",999);
  281.                 format(text,sizeof(text),"Admin %s is ban you from server!",GetName(playerid));
  282.                 SCM(GetPVarInt(playerid,"pplayerid"),-1,text);              }
  283.                 case 2: {
  284.                 ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_INPUT,"Admin Control Panel","Type admin level [1-5]","Make","Ëxit");
  285.                 }
  286.             }
  287.          }
  288.             case DIALOG_ADMIN:
  289.             {
  290.             if(!response) return SCM(playerid,-1,"Dialog is closed");
  291.             new
  292.                 string[128];
  293.             P_Data[GetPVarInt(playerid,"pplayerid")][pAdmin] = strval(inputtext);
  294.             format(string,sizeof(string),"Now you are admin level %d",strval(inputtext));
  295.             SCM(GetPVarInt(playerid,"pplayerid"),-1,string);
  296.             format(string,sizeof(string),"Player %s is now admin level %d",GetName(GetPVarInt(playerid,"pplayerid")),strval(inputtext));
  297.             SCM(playerid,-1,string);
  298.             SetPVarInt(playerid,"pplayerid",999);
  299.         }
  300.             case RCON_DIALOG:
  301.             {
  302.             if(!response) return SCM(playerid,-1,"Dialog is closed");
  303.             new
  304.                 string[128];
  305.                 switch(listitem)
  306.                 {
  307.                 case 0: {//Server name
  308.                 ShowPlayerDialog(playerid,RCON_DIALOG+1,DIALOG_STYLE_INPUT,"Server name","Type new server name","Insert","Exit");
  309.                 }
  310.                 case 1: {//Map name
  311.                 ShowPlayerDialog(playerid,RCON_DIALOG+2,DIALOG_STYLE_INPUT,"Map name","Type new map name","Insert","Exit");
  312.                 }
  313.                 case 2: {//Web adress
  314.                 ShowPlayerDialog(playerid,RCON_DIALOG+3,DIALOG_STYLE_INPUT,"Web adress","Type new web adress","Insert","Exit");
  315.                 }
  316.                 case 3: {//Unlock
  317.                 SendRconCommand("password 0");
  318.                 }
  319.                 case 4: {//lock
  320.                 ShowPlayerDialog(playerid,RCON_DIALOG+4,DIALOG_STYLE_INPUT,"LOCK server","Type password for server","Insert","Exit");
  321.                 }
  322.                 case 5: {//GMX
  323.                 format(string,sizeof(string),"Admin %s has restart server",GetName(playerid));
  324.                 SCMToAll(-1,string);
  325.                 SendRconCommand("gmx");
  326.                 }
  327.                 case 6: {//Password
  328.                 ShowPlayerDialog(playerid,RCON_DIALOG+5,DIALOG_STYLE_INPUT,"Change password","Type new RCON password","Insert","Exit");
  329.                 }
  330.                 case 7: {//Turn Off
  331.                 format(string,sizeof(string),"Admin %s has shutted down server",GetName(playerid));
  332.                 SCMToAll(-1,string);
  333.                 SendRconCommand("exit");
  334.                 }
  335.                 }
  336.             }
  337.         case RCON_DIALOG+1:
  338.             {
  339.             new string[32];
  340.             format(string, 16, "hostname %s",inputtext);
  341.             SendRconCommand(string);
  342.             }
  343.         case RCON_DIALOG+2:
  344.             {
  345.             new string[32];
  346.             format(string, 16, "mapname %s",inputtext);
  347.             SendRconCommand(string);
  348.             }
  349.         case RCON_DIALOG+3:
  350.             {
  351.             new string[32];
  352.             format(string, 16, "weburl %s",inputtext);
  353.             SendRconCommand(string);
  354.             }
  355.         case RCON_DIALOG+4:
  356.             {
  357.             new string[32];
  358.             format(string, 16, "password %s",inputtext);
  359.             SendRconCommand(string);
  360.             }
  361.         case RCON_DIALOG+5:
  362.             {
  363.             new string[32];
  364.             format(string, 16, "rcon_password %s",inputtext);
  365.             SendRconCommand(string);
  366.             }
  367.        }
  368.     return 1;
  369. }
  370.  
  371. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  372. {
  373.     if(P_Data[playerid][pAdmin] > 0 && P_Data[playerid][pAdmin] < 5) {
  374.     ShowPlayerDialog(playerid,DIALOG_CLICK,DIALOG_STYLE_LIST,"Admin Control Panel","Kick\nBan","Press","Exit");
  375.     SetPVarInt(playerid,"pplayerid",clickedplayerid);}
  376.     else if(P_Data[playerid][pAdmin] == 5) {
  377.     ShowPlayerDialog(playerid,DIALOG_CLICK,DIALOG_STYLE_LIST,"Admin Control Panel","Kick\nBan\nMake Admin","Press","Exit");
  378.     SetPVarInt(playerid,"pplayerid",clickedplayerid);}
  379.     return 1;
  380. }
  381. public LoadPlayerData(playerid, name[], value[])
  382. {
  383.     INI_Int("Password", P_Data[playerid][pPassword]);
  384.     INI_Int("Admin", P_Data[playerid][pAdmin]);
  385.     INI_Int("Money", P_Data[playerid][pMoney]);
  386.     INI_Int("Score", P_Data[playerid][pScore]);
  387.     INI_Int("Skin", P_Data[playerid][pSkin]);
  388.     INI_Int("Warn", P_Data[playerid][pWarn]);
  389.     INI_Int("VIP", P_Data[playerid][VIP]);
  390.     return 1;
  391. }
  392. stock GetName(playerid)
  393. {
  394.     new
  395.         pName[MAX_PLAYER_NAME];
  396.  
  397.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  398.     return pName;
  399. }
  400. stock udb_hash(buf[]) {
  401.     new length=strlen(buf);
  402.     new s1 = 1;
  403.     new s2 = 0;
  404.     new n;
  405.     for (n=0; n<length; n++)
  406.     {
  407.        s1 = (s1 + buf[n]) % 65521;
  408.        s2 = (s2 + s1)     % 65521;
  409.     }
  410.     return (s2 << 16) + s1;
  411. }
  412. //======================Commands=====================
  413.  
  414. YCMD:duty(playerid, params[], help)
  415. {
  416.         #pragma unused help
  417.         #pragma unused params
  418.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  419.         new
  420.             string[128];
  421.         if(P_Data[playerid][pDuty] == 0) {
  422.         format(string,sizeof(string),""COL_ORA"Admin "COL_WHITE"%s "COL_ORA"is now on duty",GetName(playerid));
  423.         SCMToAll(-1,string); P_Data[playerid][pDuty] = 1;}
  424.         else {
  425.         format(string,sizeof(string),""COL_ORA"Admin "COL_WHITE"%s "COL_ORA"is now off duty",GetName(playerid));
  426.         SCMToAll(-1,string); P_Data[playerid][pDuty] = 1;}
  427.         return 1;
  428. }
  429. YCMD:ban(playerid, params[], help)
  430. {
  431.         #pragma unused help
  432.         if(P_Data[playerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  433.         new
  434.             string[128],pplayerid, reason[48];
  435.         if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /ban [Player ID/Player Name] [Reason]");
  436.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  437.         if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
  438.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is ban player "COL_WHITE"%s  "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
  439.         SCMToAll(-1,string);
  440.         Bans(playerid,pplayerid,reason);
  441.         Ban(pplayerid);
  442.         return 1;
  443. }
  444. YCMD:count(playerid, params[], help)
  445. {
  446.         #pragma unused help
  447.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  448.         if(cdstarted == 1) return SCM(playerid, COLOR_RED, "The countdown has already included!");
  449.         new
  450.             seconds;
  451.         if(sscanf(params, "i", seconds)) return SCM(playerid, COLOR_RED, "Usage: /count [How much secunds]");
  452.         countd = seconds;
  453.         GameTextForAll("COUNT DOWN START",2000,6);
  454.         countdown = SetTimer("cd",1000,true);
  455.         return 1;
  456. }
  457. YCMD:clearchat(playerid, params[], help)
  458. {
  459.         #pragma unused help
  460.         #pragma unused params
  461.         if(P_Data[playerid][pAdmin] == 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  462.         for(new chat = 0; chat <= 25; chat++)
  463.         SCMToAll(-1, " ");
  464.         SCMToAll(-1,""COL_GREEN"Chat cleared.");
  465.         return 1;
  466. }
  467. YCMD:kick(playerid, params[], help)
  468. {
  469.         #pragma unused help
  470.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  471.         new
  472.             string[128],pplayerid, reason[48];
  473.         if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /kick [Player ID/Player Name] [Reason]");
  474.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  475.         if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
  476.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is kick player "COL_WHITE"%s  "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
  477.         SCMToAll(-1,string);
  478.         Kick(pplayerid);
  479.         return 1;
  480. }
  481. YCMD:goto(playerid, params[], help)
  482. {
  483.         #pragma unused help
  484.         if(P_Data[playerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  485.         new
  486.             pplayerid,Float:Pos[3];
  487.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /goto [Player ID]");
  488.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  489.         GetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
  490.         SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
  491.         return 1;
  492. }
  493. YCMD:mute(playerid, params[], help)
  494. {
  495.         #pragma unused help
  496.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  497.         new
  498.             pplayerid,reason[48],string[128];
  499.         if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /mute [Player ID/Player Name] [Reason]");
  500.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  501.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has muted player "COL_WHITE"%s. "COL_RED"Reason: "COL_WHITE"%s",GetName(playerid),GetName(pplayerid),reason);
  502.         SCMToAll(COLOR_RED,string);
  503.         P_Data[pplayerid][pMute] = 1;
  504.         return 1;
  505. }
  506. YCMD:unmute(playerid, params[], help)
  507. {
  508.         #pragma unused help
  509.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  510.         new
  511.             pplayerid,string[128];
  512.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /unmute [Player ID/Player Name]");
  513.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  514.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has unmuted player "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
  515.         SCMToAll(COLOR_RED,string);
  516.         P_Data[pplayerid][pMute] = 0;
  517.         return 1;
  518. }
  519. YCMD:getip(playerid, params[], help)
  520. {
  521.         #pragma unused help
  522.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  523.         new
  524.             pplayerid,ip[64],string[128];
  525.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /getip [Player ID/Player Name]");
  526.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  527.         GetPlayerIp(pplayerid,ip,50);
  528.         format(string,sizeof(string),""COL_BLUE"IP from player "COL_WHITE"%s "COL_BLUE"is "COL_WHITE"%s",GetName(playerid),ip);
  529.         SCM(playerid,COLOR_RED,string);
  530.         return 1;
  531. }
  532. YCMD:slap(playerid, params[], help)
  533. {
  534.         #pragma unused help
  535.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  536.         new
  537.             pplayerid,Float:health,string[128],reason[48];
  538.         if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /slap [Player ID/Player Name] [Reason]");
  539.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  540.         GetPlayerHealth(pplayerid,health); SetPlayerHealth(pplayerid,health-10);
  541.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has slaped player "COL_WHITE"%s. "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
  542.         SCMToAll(COLOR_RED,string);
  543.         return 1;
  544. }
  545. YCMD:amsg(playerid, params[], help)
  546. {
  547.         #pragma unused help
  548.         if(P_Data[playerid][pAdmin] == 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  549.         new
  550.             pplayerid,string[128],message[48];
  551.         if(sscanf(params, "us[48]", pplayerid,message)) return SCM(playerid, COLOR_RED, "Usage: /amsg [Player ID/Player Name] [Message]");
  552.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  553.         format(string,sizeof(string),""COL_WHITE"AdminMSG "COL_RED"%s "COL_WHITE"| Message: "COL_RED"%s",GetName(playerid),message);
  554.         SCM(pplayerid,COLOR_RED,string);
  555.         SCM(playerid,COLOR_RED,"Admin message sent!");
  556.         return 1;
  557. }
  558. YCMD:a(playerid, params[], help)
  559. {
  560.         #pragma unused help
  561.         if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  562.         new
  563.             text[128];
  564.         if(sscanf(params, "s[128]",text)) return SCM(playerid, COLOR_RED, "Usage: /achat [Text]");
  565.         format(text,sizeof(text),""COL_WHITE"Admin "COL_RED"%s "COL_WHITE"| Text: "COL_RED"%s",GetName(playerid),params[0]);
  566.         foreach(Player, i) {
  567.         if(P_Data[i][pAdmin] > 0){
  568.         SCM(i,COLOR_RED,text);}}
  569.         return 1;
  570. }
  571. YCMD:ann(playerid, params[], help)
  572. {
  573.         #pragma unused help
  574.         if(P_Data[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  575.         new string[128],style;
  576.         if(sscanf(params, "s[128]i",string,style)) return SCM(playerid, COLOR_RED, "Usage: /ann [Text] [Text Style 0-3]");
  577.         GameTextForAll(string,4000,style);
  578.         return 1;
  579. }
  580. YCMD:freeze(playerid, params[], help)
  581. {
  582.         #pragma unused help
  583.         if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  584.         new
  585.             pplayerid,string[128],reason[48];
  586.         if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /freeze [Player ID/Player Name] [Reason]");
  587.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  588.         if(P_Data[pplayerid][pFrozen] == 1)  return SCM(playerid, COLOR_RED, "Player is already frozen!");
  589.         TogglePlayerControllable(pplayerid, false);
  590.         P_Data[pplayerid][pFrozen] = 1;
  591.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has freezed player "COL_WHITE"%s. "COL_RED"Reason: "COL_WHITE"%s",GetName(playerid),GetName(pplayerid),reason);
  592.         SCMToAll(COLOR_RED,string);
  593.         return 1;
  594. }
  595. YCMD:unfreeze(playerid, params[], help)
  596. {
  597.         #pragma unused help
  598.         if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  599.         new
  600.             pplayerid,string[128];
  601.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /unfreeze [Player ID/Player Name]");
  602.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  603.         if(P_Data[pplayerid][pFrozen] == 0)  return SCM(playerid, COLOR_RED, "Player isn't frozen!");
  604.         TogglePlayerControllable(pplayerid, true);
  605.         P_Data[pplayerid][pFrozen] = 0;
  606.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has unfreeze player "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
  607.         SCMToAll(COLOR_RED,string);
  608.         return 1;
  609. }
  610. YCMD:spec(playerid, params[], help)
  611. {
  612.         #pragma unused help
  613.         if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  614.         new
  615.             pplayerid,Float:Pos[3],string[128];
  616.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /spec [Player ID/Player Name]");
  617.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  618.         GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  619.         SetPVarFloat(playerid,"XPos",Pos[0]);
  620.         SetPVarFloat(playerid,"YPos",Pos[1]);
  621.         SetPVarFloat(playerid,"ZPos",Pos[2]);
  622.         SetPVarInt(playerid,"Interior",GetPlayerInterior(playerid));
  623.         SetPVarInt(playerid,"VW",GetPlayerVirtualWorld(playerid));
  624.         P_Data[playerid][pSpecating] = 1;
  625.         format(string,sizeof(string),"~g~Name: ~w~%s    ~g~Score: ~w~%d    ~g~Money: ~w~%d",GetName(pplayerid),GetPlayerScore(pplayerid),GetPlayerMoney(pplayerid));
  626.         TextDrawSetString(Spec1[playerid],string);
  627.         TextDrawShowForPlayer(playerid,Spec1[playerid]);
  628.         TextDrawShowForPlayer(playerid,Spec0[playerid]);
  629.         if ( !IsPlayerInAnyVehicle(pplayerid) ) {
  630.         TogglePlayerSpectating(playerid, 1);
  631.         PlayerSpectatePlayer(playerid, pplayerid);
  632.         SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
  633.         SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pplayerid));
  634.         return 1; }
  635.         else {
  636.         TogglePlayerSpectating(playerid, 1);
  637.         PlayerSpectateVehicle(playerid, GetPlayerVehicleID(pplayerid));
  638.         SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
  639.         SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pplayerid)); }
  640.         return 1;
  641. }
  642. YCMD:specoff(playerid, params[], help)
  643. {
  644.         #pragma unused help
  645.         #pragma unused params
  646.         if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  647.         if(P_Data[playerid][pSpecating] == 0)return SCM(playerid, COLOR_RED, "You don't specate nobody!");
  648.         TogglePlayerSpectating(playerid, 0);
  649.         SetPlayerPos(playerid,GetPVarFloat(playerid,"XPos"),GetPVarFloat(playerid,"YPos"),GetPVarFloat(playerid,"ZPos"));
  650.         SetPlayerInterior(playerid,GetPVarInt(playerid,"Interior"));
  651.         SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"VW"));
  652.         SetPVarFloat(playerid,"XPos",999);
  653.         SetPVarFloat(playerid,"YPos",999);
  654.         SetPVarFloat(playerid,"ZPos",999);
  655.         SetPVarInt(playerid,"Interior",0);
  656.         SetPVarInt(playerid,"VW",0);
  657.         P_Data[playerid][pSpecating] = 0;
  658.         TextDrawHideForPlayer(playerid,Spec1[playerid]);
  659.         TextDrawHideForPlayer(playerid,Spec0[playerid]);
  660.         return 1;
  661. }
  662. YCMD:heal(playerid, params[], help)
  663. {
  664.         #pragma unused help
  665.         #pragma unused params
  666.         if(P_Data[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  667.         SetPlayerHealth(playerid,100);
  668.         return 1;
  669. }
  670. YCMD:setskin(playerid, params[], help)
  671. {
  672.         #pragma unused help
  673.         if(P_Data[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  674.         new
  675.             pplayerid,skin,string[128];
  676.         if(sscanf(params, "ui", pplayerid,skin)) return SCM(playerid, COLOR_RED, "Usage: /setskin [Player ID/Player Name] [Skin ID]");
  677.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  678.         P_Data[playerid][pSkin] = skin;
  679.         SetPlayerSkin(pplayerid,skin);
  680.         format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has set skin "COL_WHITE"%d "COL_YELLOW"to you",GetName(playerid),skin);
  681.         SCM(pplayerid,-1,string);
  682.         format(string,sizeof(string),""COL_YELLOW"Skin seted to player "COL_WHITE"%s",GetName(pplayerid));
  683.         SCM(playerid,-1,string);
  684.         return 1;
  685. }
  686. YCMD:eject(playerid, params[], help)
  687. {
  688.         #pragma unused help
  689.         if(P_Data[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  690.         new
  691.             pplayerid,string[128];
  692.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /eject [Player ID/Player Name]");
  693.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  694.         RemovePlayerFromVehicle(pplayerid);
  695.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has eject you from vehicle",GetName(playerid));
  696.         SCM(pplayerid,-1,string);
  697.         return 1;
  698. }
  699. YCMD:setvhealth(playerid, params[], help)
  700. {
  701.         #pragma unused help
  702.         if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  703.         new
  704.             pplayerid,Float:health;
  705.         if(sscanf(params, "ui", pplayerid,health)) return SCM(playerid, COLOR_RED, "Usage: /setvhealth [Player ID/Player Name] [Health]");
  706.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  707.         if(!IsPlayerInAnyVehicle(pplayerid)) return SCM(playerid, COLOR_RED, "Player must be intro car!");
  708.         SetVehicleHealth(GetPlayerVehicleID(pplayerid),health);
  709.         return 1;
  710. }
  711. YCMD:jetpack(playerid, params[], help)
  712. {
  713.         #pragma unused help
  714.         #pragma unused params
  715.         if(P_Data[playerid][pAdmin] < 7) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  716.         SetPlayerSpecialAction(playerid, 2);
  717.         return 1;
  718. }
  719. YCMD:kill(playerid, params[], help)
  720. {
  721.         #pragma unused help
  722.         if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  723.         new
  724.             pplayerid,string[128];
  725.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /kill [Player ID/Player Name]");
  726.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  727.         SetPlayerHealth(pplayerid,0);
  728.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has kill player "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
  729.         SCMToAll(-1,string);
  730.         return 1;
  731. }
  732. YCMD:setcarcolor(playerid, params[], help)
  733. {
  734.         #pragma unused help
  735.         if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  736.         new
  737.             pplayerid,col[2];
  738.         if(sscanf(params, "udd", pplayerid,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /setcarcolor [Player ID/Player Name] [Color 1] [Color 2]");
  739.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  740.         if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,"You must be into car!");
  741.         ChangeVehicleColor(GetPlayerVehicleID(pplayerid), col[0],col[1]);
  742.         return 1;
  743. }
  744. YCMD:warn(playerid, params[], help)
  745. {
  746.         #pragma unused help
  747.         if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  748.         new
  749.             pplayerid,string[128],reason[48];
  750.         if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /warn [Player ID/Player Name] [Reason]");
  751.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  752.         P_Data[pplayerid][pWarn] += 1;
  753.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has warned you. Reason: "COL_WHITE"%s",GetName(playerid),reason);
  754.         SCM(pplayerid,-1,string);
  755.         format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"has warned by you. Reason: "COL_WHITE"%s",GetName(pplayerid),reason);
  756.         SCM(playerid,-1,string);
  757.         if(P_Data[pplayerid][pWarn] >=5) {
  758.         Kick(pplayerid);}
  759.         return 1;
  760. }
  761. YCMD:settime(playerid, params[], help)
  762. {
  763.         #pragma unused help
  764.         if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  765.         new
  766.             time,string[128];
  767.         if(sscanf(params, "i", time)) return SCM(playerid, COLOR_RED, "Usage: /settime [Time Of They Day]");
  768.         format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has changed time to "COL_WHITE"%d",GetName(playerid),time);
  769.         SCMToAll(-1,string);
  770.         SetWorldTime(time);
  771.         return 1;
  772. }
  773. YCMD:get(playerid, params[], help)
  774. {
  775.         #pragma unused help
  776.         if(P_Data[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  777.         new
  778.             pplayerid,Float:Pos[3];
  779.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /get [Player ID]");
  780.         GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
  781.         return 1;
  782. }
  783. YCMD:fixcar(playerid, params[], help)
  784. {
  785.         #pragma unused help
  786.         #pragma unused params
  787.         if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  788.         if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_RED, "You must be into car!");
  789.         RepairVehicle(GetPlayerVehicleID(playerid));
  790.         SCM(playerid,-1,""COL_YELLOW"Vehicle repaired.");
  791.         return 1;
  792. }
  793. YCMD:amoney(playerid, params[], help)
  794. {
  795.         #pragma unused help
  796.         if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  797.         new
  798.             pplayerid,money,string[128];
  799.         if(sscanf(params, "ui", pplayerid,money)) return SCM(playerid, COLOR_RED, "Usage: /amoney [Player ID/Player Name] [Money]");
  800.         GivePlayerMoney(pplayerid, money);
  801.         format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has give you "COL_WHITE"$%d",GetName(playerid),money);
  802.         SCM(pplayerid,-1,string);
  803.         format(string,sizeof(string),""COL_YELLOW"Player "COL_WHITE"%s "COL_YELLOW"has received "COL_WHITE"$%d",GetName(pplayerid),money);
  804.         SCM(playerid,-1,string);
  805.         return 1;
  806. }
  807. YCMD:giveweapon(playerid, params[], help)
  808. {
  809.         #pragma unused help
  810.         if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  811.         new
  812.             pplayerid,gun,ammo,string[128];
  813.         if(sscanf(params, "uii", pplayerid,gun,ammo)) return SCM(playerid, COLOR_RED, "Usage: /aweapon [Player ID/Player Name] [Weapon ID] [Ammo]");
  814.         GivePlayerWeapon(pplayerid, gun,ammo);
  815.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has give you weapon id: "COL_WHITE"%d",GetName(playerid),gun);
  816.         SCM(pplayerid,-1,string);
  817.         format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"has received weapon id: "COL_WHITE"%d",GetName(pplayerid),gun);
  818.         SCM(playerid,-1,string);
  819.         return 1;
  820. }
  821.  
  822. YCMD:unban(playerid, params[], help)
  823. {
  824.         #pragma unused help
  825.         if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  826.         new
  827.             name[48],string[64];
  828.         if(sscanf(params, "s[48]",name)) return SCM(playerid, COLOR_RED, "Usage: /unban [Player Name]");
  829.         format(string,sizeof(string),"%s.ini",name);
  830.         fremove(string);
  831.         SCM(playerid, COLOR_RED, "Player has been unbaned!");
  832.         SendRconCommand(string);
  833.         SendRconCommand("reloadbans");
  834.         return 1;
  835. }
  836. YCMD:disarm(playerid, params[], help)
  837. {
  838.         #pragma unused help
  839.         if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  840.         new
  841.             pplayerid,string[64];
  842.         if(sscanf(params, "u",pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /disarm [Player ID/Player Name]");
  843.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has disarm you",GetName(playerid));
  844.         SCM(pplayerid,-1,string);
  845.         format(string,sizeof(string),""COL_RED"You'r disarm player "COL_WHITE"%s",GetName(pplayerid));
  846.         SCM(playerid,-1,string);
  847.         ResetPlayerWeapons(pplayerid);
  848.         return 1;
  849. }
  850. YCMD:unbanip(playerid, params[], help)
  851. {
  852.         #pragma unused help
  853.         if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  854.         new
  855.             ip[48],string[64];
  856.         if(sscanf(params, "s[48]",ip)) return SCM(playerid, COLOR_RED, "Usage: /unbanip [Player IP]");
  857.         format(string,sizeof(string),"unbanip %s",ip);
  858.         SendRconCommand(string);
  859.         SendRconCommand("reloadbans");
  860.         SCM(playerid, COLOR_RED, "IP has been unbaned!");
  861.         return 1;
  862. }
  863. YCMD:killall(playerid, params[], help)
  864. {
  865.         #pragma unused help
  866.         #pragma unused params
  867.         if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  868.         for(new i=0; i<GetMaxPlayers(); i++)
  869.         {
  870.         SetPlayerHealth(i,0);
  871.         }
  872.         return 1;
  873. }
  874. YCMD:explode(playerid, params[], help)
  875. {
  876.         #pragma unused help
  877.         if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  878.         new
  879.             pplayerid,string[128];
  880.         if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /aweapon [Player ID/Player Name]");
  881.         Explode(pplayerid);
  882.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has explode "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
  883.         SCMToAll(-1,string);
  884.         return 1;
  885. }
  886. YCMD:healall(playerid, params[], help)
  887. {
  888.         #pragma unused help
  889.         #pragma unused params
  890.         if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  891.         new
  892.             string[128];
  893.         for(new i = 0; i<GetMaxPlayers();i++) {
  894.         SetPlayerHealth(i,100); }
  895.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has heal all players",GetName(playerid));
  896.         SCMToAll(-1,string);
  897.         return 1;
  898. }
  899. YCMD:armourall(playerid, params[], help)
  900. {
  901.         #pragma unused help
  902.         #pragma unused params
  903.         if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  904.         new
  905.             string[128];
  906.         for(new i = 0; i<GetMaxPlayers();i++) {
  907.         SetPlayerArmour(i,100); }
  908.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has give all players armour.",GetName(playerid));
  909.         SCMToAll(-1,string);
  910.         return 1;
  911. }
  912. YCMD:rac(playerid, params[], help)
  913. {
  914.         #pragma unused help
  915.         #pragma unused params
  916.         if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  917.         new
  918.             string[128];
  919.         for(new car = 0; car<MAX_CARS;car++) {
  920.         VehicleHaveDriver(car);
  921.         SetVehicleToRespawn(car); }
  922.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has respawn all cars.",GetName(playerid));
  923.         SCMToAll(-1,string);
  924.         return 1;
  925. }
  926. YCMD:setadmin(playerid, params[], help)
  927. {
  928.         #pragma unused help
  929.         if(P_Data[playerid][pAdmin] < 8 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  930.         new
  931.             string[128],pplayerid,level;
  932.         if(sscanf(params, "ui", pplayerid,level)) return SCM(playerid, COLOR_RED, "Usage: /setadmin [Player ID/Player Name] [Admin Level]");
  933.         if(level > 8 || level <= 0) return SCM(playerid,COLOR_RED,"Max level is 8");
  934.         if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
  935.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has given you admin level"COL_WHITE" %d",GetName(playerid),level);
  936.         SCM(pplayerid,-1,string);
  937.         format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"now have admin level"COL_WHITE" %d",GetName(pplayerid),level);
  938.         SCM(playerid,-1,string);
  939.         P_Data[pplayerid][pAdmin] = level;
  940.         return 1;
  941. }
  942. YCMD:tpall(playerid, params[], help)
  943. {
  944.         #pragma unused help
  945.         #pragma unused params
  946.         if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  947.         new
  948.             string[128],Float:Pos[3];
  949.             GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  950.         foreach(Player, i) {
  951.         SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid, GetPlayerInterior(playerid));SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid)); }
  952.         format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has port all players to him.",GetName(playerid));
  953.         SCMToAll(-1,string);
  954.         return 1;
  955. }
  956. YCMD:setscore(playerid, params[], help)
  957. {
  958.         #pragma unused help
  959.         if(P_Data[playerid][pAdmin] < 7) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  960.         new
  961.             pplayerid,string[128],score;
  962.         if(sscanf(params, "u", pplayerid,score)) return SCM(playerid, COLOR_RED, "Usage: /setscore [Player ID] [Score]");
  963.         format(string,sizeof(string),""COL_RED"Admin "COL_YELLOW"%s "COL_RED"set your score to "COL_YELLOW"%d",GetName(playerid),score);
  964.         SCM(pplayerid,-1,string);
  965.         format(string,sizeof(string),""COL_RED"You are set score to player "COL_YELLOW"%s. "COL_RED"Score: "COL_YELLOW"%d",GetName(pplayerid),score);
  966.         SCM(playerid,-1,string);
  967.         P_Data[playerid][pScore] = score;
  968.         return 1;
  969. }
  970. YCMD:setweather(playerid, params[], help)
  971. {
  972.         #pragma unused help
  973.         if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  974.         new
  975.             string[128],weather;
  976.         if(sscanf(params, "i", weather)) return SCM(playerid, COLOR_RED, "Usage: /setweather [weather ID (0 - 45)]");
  977.         if(weather > 45 || weather < 0) return SCM(playerid, COLOR_RED, "Wrong weather id!");
  978.         format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has change weather to id: "COL_WHITE"%d",GetName(playerid),weather);
  979.         SCMToAll(-1,string);
  980.         return 1;
  981. }
  982. YCMD:setvip(playerid, params[], help)
  983. {
  984.         #pragma unused help
  985.         if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  986.         new
  987.             string[128],pplayerid,level;
  988.         if(sscanf(params, "ui", pplayerid, level)) return SCM(playerid, COLOR_RED, "Usage: /setvip [Player ID/Player Name] [VIP Level]");
  989.         if(level > 3 || level < 0) return SCM(playerid, COLOR_RED, "Wrong level id!");
  990.         P_Data[pplayerid][VIP] = level;
  991.         format(string,sizeof(string),""COL_YELLOW"Player "COL_WHITE"%s "COL_YELLOW"has promoted to VIP level "COL_WHITE"%d",GetName(pplayerid),level);
  992.         SCMToAll(-1,string);
  993.         return 1;
  994. }
  995. YCMD:kickall(playerid, params[], help)
  996. {
  997.         #pragma unused help
  998.         #pragma unused params
  999.         if(P_Data[playerid][pAdmin] < 7) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
  1000.         for(new i=0; i<GetMaxPlayers(); i++)
  1001.         {
  1002.         Kick(i);
  1003.         }
  1004.         return 1;
  1005. }
  1006. //======================VIP Commands==========================================//
  1007. YCMD:v(playerid, params[], help)
  1008. {
  1009.         #pragma unused help
  1010.         if(P_Data[playerid][VIP] == 0) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1011.         new
  1012.             text[128];
  1013.         if(sscanf(params, "s[128]",text)) return SCM(playerid, COLOR_RED, "Usage: /vchat [Text]");
  1014.         format(text,sizeof(text),""COL_WHITE"VIP "COL_YELLOW"%s "COL_WHITE"| Text: "COL_YELLOW"%s",GetName(playerid),params[0]);
  1015.         foreach(Player, i) {
  1016.         if(P_Data[i][VIP] > 0){
  1017.         SCM(i,-1,text);}}
  1018.         return 1;
  1019. }
  1020. YCMD:vfix(playerid, params[], help)
  1021. {
  1022.         #pragma unused help
  1023.         #pragma unused params
  1024.         if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1025.         RepairVehicle(GetPlayerVehicleID(playerid));
  1026.         SCM(playerid, -1, ""COL_YELLOW"Your vehicle has succesfuly repaired!");
  1027.         return 1;
  1028. }
  1029. YCMD:vvehcolor(playerid, params[], help)
  1030. {
  1031.         #pragma unused help
  1032.         if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1033.         new
  1034.             col[2];
  1035.         if(sscanf(params, "ii",col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vvehcolor [Color 1] [Color 2]");
  1036.         ChangeVehicleColor(GetPlayerVehicleID(playerid), col[0],col[1]);
  1037.         SCM(playerid,-1,""COL_YELLOW"Vehicle color changed!");
  1038.         return 1;
  1039. }
  1040. YCMD:vbike(playerid, params[], help)
  1041. {
  1042.         #pragma unused help
  1043.         if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1044.         new
  1045.             col[2],vehicle;
  1046.         if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vbike [Bike ID] [Color 1] [Color 2]");
  1047.         if(vehicle == 461 || vehicle == 463 || vehicle == 468 || vehicle == 521 || vehicle == 522) {
  1048.         Cars(playerid, vehicle,col[0],col[1]); }
  1049.         return 1;
  1050. }
  1051. YCMD:vipheal(playerid, params[], help)
  1052. {
  1053.         #pragma unused help
  1054.         #pragma unused params
  1055.         if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1056.         SetPlayerHealth(playerid, 100.0);
  1057.         SCM(playerid,-1,""COL_YELLOW"Heal changed to 100.0!");
  1058.         return 1;
  1059. }
  1060. YCMD:vheal(playerid, params[], help)
  1061. {
  1062.         #pragma unused help
  1063.         #pragma unused params
  1064.         if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1065.         SetPlayerArmour(playerid, 100.0);
  1066.         SCM(playerid,-1,""COL_YELLOW"Armoru changed to 100.0!");
  1067.         return 1;
  1068. }
  1069. YCMD:vskin(playerid, params[], help)
  1070. {
  1071.         #pragma unused help
  1072.         if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1073.         new skin;
  1074.         if(sscanf(params, "i",skin)) return SCM(playerid, COLOR_RED, "Usage: /vskin [Skin ID]");
  1075.         if(skin < 0 || skin > 299) return SCM(playerid, COLOR_RED, "Wrong skin id!");
  1076.         SetPlayerSkin(playerid,skin);
  1077.         P_Data[playerid][pSkin] = skin;
  1078.         SCM(playerid,-1,""COL_YELLOW"Skin changed!");
  1079.         return 1;
  1080. }
  1081. YCMD:vweather(playerid, params[], help)
  1082. {
  1083.         #pragma unused help
  1084.         if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1085.         new weather;
  1086.         if(sscanf(params, "i", weather)) return SCM(playerid, COLOR_RED, "Usage: /vweather [weather ID (0 - 45)]");
  1087.         if(weather > 45 || weather < 0) return SCM(playerid, COLOR_RED, "Wrong weather id!");
  1088.         SetPlayerWeather(playerid, weather);
  1089.         SCM(playerid,-1,""COL_YELLOW"Weather changed!");
  1090.         return 1;
  1091. }
  1092. YCMD:vtime(playerid, params[], help)
  1093. {
  1094.         #pragma unused help
  1095.         if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1096.         new hour,minute;
  1097.         if(sscanf(params, "ii", hour,minute)) return SCM(playerid, COLOR_RED, "Usage: /vtime [Hours] [Minutes]");
  1098.         if(hour > 24 || hour < 0) return SCM(playerid, COLOR_RED, "Wrong hour id!");
  1099.         if(minute > 60 || minute < 0) return SCM(playerid, COLOR_RED, "Wrong minute id!");
  1100.         SetPlayerTime(playerid, hour,minute);
  1101.         SCM(playerid,-1,""COL_YELLOW"Time for you changed!");
  1102.         return 1;
  1103. }
  1104. YCMD:vcar(playerid, params[], help)
  1105. {
  1106.         #pragma unused help
  1107.         if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1108.         new
  1109.             col[2],vehicle;
  1110.         if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vcar [Car ID] [Color 1] [Color 2]");
  1111.         if(vehicle == 461 || vehicle == 463 || vehicle == 468 || vehicle == 521 || vehicle == 522 || vehicle == 417
  1112.         || vehicle == 425 || vehicle == 447 || vehicle == 487 || vehicle == 488 || vehicle == 497 || vehicle == 522|| vehicle == 548 || vehicle == 563
  1113.         || vehicle == 430 || vehicle == 446 || vehicle == 452 || vehicle == 453|| vehicle == 454 || vehicle == 472 || vehicle == 473 || vehicle == 484 || vehicle == 493 || vehicle == 595) return SCM(playerid, COLOR_RED, "Just cars please!");
  1114.         Cars(playerid, vehicle,col[0],col[1]);
  1115.         return 1;
  1116. }
  1117. YCMD:vjetpack(playerid, params[], help)
  1118. {
  1119.         #pragma unused help
  1120.         #pragma unused params
  1121.         if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1122.         SetPlayerSpecialAction(playerid, 2);
  1123.         return 1;
  1124. }
  1125.  
  1126. YCMD:vheli(playerid, params[], help)
  1127. {
  1128.         #pragma unused help
  1129.         if(P_Data[playerid][VIP] < 3) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1130.         new
  1131.             col[2],vehicle;
  1132.         if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vheli [Heli ID] [Color 1] [Color 2]");
  1133.         if(vehicle == 417 || vehicle == 425 || vehicle == 447 || vehicle == 487 || vehicle == 488 || vehicle == 497
  1134.         || vehicle == 522 || vehicle == 548 || vehicle == 563 )
  1135.         {
  1136.         Cars(playerid, vehicle,col[0],col[1]); } else {SCM(playerid, COLOR_RED, "Just helicopter id!");}
  1137.         return 1;
  1138. }
  1139. YCMD:vplane(playerid, params[], help)
  1140. {
  1141.         #pragma unused help
  1142.         if(P_Data[playerid][VIP] < 3) return SCM(playerid, COLOR_RED, "You need to be VIP!");
  1143.         new
  1144.             col[2],vehicle;
  1145.         if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vplane [Car ID] [Color 1] [Color 2]");
  1146.         if(vehicle == 460 || vehicle == 476 || vehicle == 511 || vehicle == 513 || vehicle == 512|| vehicle == 519
  1147.         || vehicle == 553|| vehicle == 577 || vehicle == 592 || vehicle == 593 )
  1148.         {
  1149.         Cars(playerid, vehicle,col[0],col[1]); } else {SCM(playerid, COLOR_RED, "You must type id of plane!");}
  1150.         return 1;
  1151. }
  1152. COMMAND:report(playerid, params[])
  1153. {
  1154.  
  1155.         new
  1156.             pplayerid,string[1000],reason[100];
  1157.         if(sscanf(params, "ds[100]", pplayerid,reason)) return SCM(playerid, COLOR_RED, ""COL_RED"Info: "COL_WHITE"/Report (Playerid) (Reason)");
  1158.         if(pplayerid == IPI) return SCM(playerid, -1, ""COL_RED"Error: "COL_WHITE"Wrong Playerid.");
  1159.         format(string,sizeof(string),""COL_BLUE"(REPORT): "COL_WHITE" \"%s (%d)\" has reported against \"%s (%d)\". (Reason: %s)",GetName(playerid),playerid,GetName(pplayerid),pplayerid,reason);
  1160.         SendAdminMessage(string);
  1161.         SCM(playerid, -1, ""COL_GREEN"Report successfully sended, please wait for the admins to take action.");
  1162.         return 1;
  1163. }
  1164. forward PingKicker();
  1165. public PingKicker()
  1166. {
  1167. new string[128];
  1168. foreach(Player, i) {
  1169. if(GetPlayerPing(i) > MAX_PING) {
  1170. format(string, sizeof (string), "Exceeding Ping Limit. Max ping is %d", MAX_PING);
  1171. SCM(i,COLOR_RED,string);
  1172. Kick(i); }
  1173. }
  1174. }
  1175. forward ClearSpam();
  1176. public ClearSpam()
  1177. {
  1178. foreach(Player, i) {
  1179. if(P_Data[i][pSpam] > 1) {
  1180. P_Data[i][pSpam] = 0;}
  1181. }
  1182. }
  1183. forward cd();
  1184. public cd()
  1185. {
  1186.         countd--;
  1187.         new
  1188.              str[16];
  1189.         format(str,32,"~g~%d",countd);
  1190.         GameTextForAll(str,1000,6);
  1191.         if(countd==0)
  1192.         {
  1193.         GameTextForAll("~g~GO!",2000,6);
  1194.         KillTimer(countdown);
  1195.         cdstarted = 0;
  1196.         }
  1197. }
  1198. stock Explode(playerid)
  1199. {
  1200. new Float:Pos[3];
  1201. GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
  1202. CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 10);
  1203. }
  1204. stock VehicleHaveDriver(car)
  1205. {
  1206.         foreach(Player, i)
  1207.         {
  1208.         if(IsPlayerInVehicle(i, car)) return 1;
  1209.         }
  1210.         return 1;
  1211. }
  1212. stock Bans(playerid,targetid,reason[])
  1213. {
  1214.     new string[128];
  1215.     format(string, sizeof(string), "Admin %s has ban player %s. Reason: %s\n", GetName(playerid),GetName(targetid),reason);
  1216.     new File:hFile;
  1217.     hFile = fopen("/ShAdmin/Bans.txt", io_append);
  1218.     fwrite(hFile, string);
  1219.     fclose(hFile);
  1220. }
  1221. stock Cars(playerid, model, color1, color2)
  1222. {
  1223. new Float:Pos[4];
  1224. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
  1225. if(GetPVarInt(playerid,"VipCar") != -1) DestroyVehicle(GetPVarInt(playerid,"VipCar"));
  1226. new vehicleid = CreateVehicle(model,Pos[0],Pos[1],Pos[2], Pos[3],color1, color2, 3600);
  1227. SetPVarInt(playerid,"VipCar", vehicleid);
  1228. SCM(playerid,-1,""COL_YELLOW"Vehicle spawned!");
  1229. }
  1230. stock SendAdminMessage(text[])
  1231. {
  1232.     for(new i = 0; i < MAX_PLAYERS; i++)
  1233.     {
  1234.         if(P_Data[i][pAdmin]>=1)
  1235.         {
  1236.             SendClientMessage(i,-1,text);
  1237.         }
  1238.     }
  1239.     return true;
  1240. }
Advertisement
Add Comment
Please, Sign In to add comment