Advertisement
System32

S32_Admin

Nov 10th, 2011
1,531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 78.04 KB | None | 0 0
  1. #include <a_samp>
  2. #include <a_mysql>
  3. #include <foreach>
  4. #include <rBits>
  5. #include <YSI\y_commands>
  6.  
  7. #define ClearChat()                                             for(new l; l < 30; l++) SendClientMessageToAll(-1, " ")
  8. #define ClearChatForPlayer(%0)                                  for(new l; l < 30; l++) SendClientMessage(%0, -1, " ")
  9. #define VERSION                                                 "1.0.0"
  10.  
  11. #define COLOR_WHITE                                             0xFFFFFFAA
  12. #define COLOR_LIME                                              0x10F441AA
  13. #define COLOR_KRED                                              0xFF0000FF
  14. #define COLOR_RED                                               0xAA3333AA
  15. #define COLOR_GREY                                              0xAFAFAFAA
  16. #define COLOR_GREEN                                             0x33AA33AA
  17. #define COLOR_YELLOW                                            0xFFFF00AA
  18. #define COLOR_ORANGE                                            0xFF9900AA
  19. #define COLOR_LIGHTBLUE                                         0x6DC5F3FF
  20. #define COLOR_BLUE                                              0x2641FEAA
  21.  
  22. //Current dialog ID: 9 | Always increase this when you add new dialog!
  23.  
  24. new Query[1000], Float: Pos[4], text2[256], title[128], string[128], string2[128], Text3D: Duty[MAX_PLAYERS], IsChatOnOrOff;
  25. new MuteTimer[MAX_PLAYERS], JailTimer[MAX_PLAYERS];
  26. new Text: BanBox, Text: BanName, Text: BanAdministrator, Text: BanReason;
  27.  
  28. new rBit1: gSpectateType <MAX_PLAYERS>;
  29. new rBit1: OnDuty <MAX_PLAYERS>;
  30. new rBit1: IsPlayerFreezed <MAX_PLAYERS>;
  31. new rBit1: IsPlayerLogged <MAX_PLAYERS>;
  32. new rBit1: InJailZone <MAX_PLAYERS>;
  33. new rBit1: PlayerMuted <MAX_PLAYERS>;
  34. new rBit16: gSpectateID <MAX_PLAYERS>;
  35.  
  36.  
  37. enum pInfo
  38. {
  39.     pMoney,
  40.     pScore,
  41.     pKills,
  42.     pDeaths,
  43.     pAdmin,
  44.     pWarns
  45. }
  46. new PlayerInfo[MAX_PLAYERS][pInfo];
  47.  
  48. public OnFilterScriptInit()
  49. {
  50.     mysql_debug(1);
  51.     mysql_connect("localhost", "root", "sa:mp", "");
  52.     if(mysql_ping() >= 1) print(" MySQL: Connecting successful!\n");
  53.     else print(" MySQL: Connecting unsuccessful!\n");
  54.    
  55.     print("\n--------------------------------------");
  56.     print(" Blank Filterscript by your name here");
  57.     print("--------------------------------------\n");
  58.    
  59.     BanBox = TextDrawCreate(650.000000, 0.000000, ".");
  60.     TextDrawBackgroundColor(BanBox, 255);
  61.     TextDrawFont(BanBox, 1);
  62.     TextDrawLetterSize(BanBox, 0.500000, 50.000000);
  63.     TextDrawColor(BanBox, -1);
  64.     TextDrawSetOutline(BanBox, 0);
  65.     TextDrawSetProportional(BanBox, 1);
  66.     TextDrawSetShadow(BanBox, 1);
  67.     TextDrawUseBox(BanBox, 1);
  68.     TextDrawBoxColor(BanBox, 255);
  69.     TextDrawTextSize(BanBox, -30.000000, 0.000000);
  70.  
  71.     BanName = TextDrawCreate(240.000000, 151.000000, "Name");
  72.     TextDrawBackgroundColor(BanName, 255);
  73.     TextDrawFont(BanName, 1);
  74.     TextDrawLetterSize(BanName, 0.500000, 1.000000);
  75.     TextDrawColor(BanName, -16776961);
  76.     TextDrawSetOutline(BanName, 0);
  77.     TextDrawSetProportional(BanName, 1);
  78.     TextDrawSetShadow(BanName, 1);
  79.  
  80.     BanAdministrator = TextDrawCreate(240.000000, 161.000000, "Administrator");
  81.     TextDrawBackgroundColor(BanAdministrator, 255);
  82.     TextDrawFont(BanAdministrator, 1);
  83.     TextDrawLetterSize(BanAdministrator, 0.500000, 1.000000);
  84.     TextDrawColor(BanAdministrator, -16776961);
  85.     TextDrawSetOutline(BanAdministrator, 0);
  86.     TextDrawSetProportional(BanAdministrator, 1);
  87.     TextDrawSetShadow(BanAdministrator, 1);
  88.  
  89.     BanReason = TextDrawCreate(240.000000, 171.000000, "Reason");
  90.     TextDrawBackgroundColor(BanReason, 255);
  91.     TextDrawFont(BanReason, 1);
  92.     TextDrawLetterSize(BanReason, 0.500000, 1.000000);
  93.     TextDrawColor(BanReason, -16776961);
  94.     TextDrawSetOutline(BanReason, 0);
  95.     TextDrawSetProportional(BanReason, 1);
  96.     TextDrawSetShadow(BanReason, 1);
  97.     return 1;
  98. }
  99.  
  100. public OnFilterScriptExit()
  101. {
  102.     return 1;
  103. }
  104.  
  105. public OnPlayerRequestClass(playerid, classid)
  106. {
  107.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  108.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  109.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerConnect(playerid)
  114. {
  115.     CustomBanCheck(playerid);
  116.     ResetPlayerMoney(playerid);
  117.     TogglePlayerClock(playerid, 0);
  118.     ClearChatForPlayer(playerid);
  119.     SendClientMessage(playerid, 0x80FF0099, "Type /help to see list of commands!");
  120.  
  121.     format(Query, sizeof(Query), "SELECT User FROM `users` WHERE `User` = '%s' LIMIT 1", mysql_get_name(playerid));
  122.     mysql_query(Query);
  123.     mysql_store_result();
  124.     if(mysql_num_rows() == 1)
  125.     {
  126.         format(title, sizeof(title), "{00CCFF}     Welcome{FFFFFF} %s!", GetName(playerid));
  127.         format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is registered!\nLogin!", GetName(playerid));
  128.         ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT , title, text2, "Ok", "Exit");
  129.     }
  130.     else
  131.     {
  132.         format(title, sizeof(title), "{00CCFF}     Welcome{FFFFFF} %s!", GetName(playerid));
  133.         format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is not registered!\nRegister!", GetName(playerid));
  134.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT , title, text2, "Ok", "Exit");
  135.     }
  136.     mysql_free_result();
  137.     return 1;
  138. }
  139.  
  140. public OnPlayerDisconnect(playerid, reason)
  141. {
  142.     if(rBit1_Get(IsPlayerLogged, playerid))
  143.     {
  144.         format(Query, sizeof(Query), "UPDATE `racuni` SET `Money` = '%d', `Score` = '%d', `Kills` = '%d', `Deaths˙= '%d', `Admin` = '%d', `Warns` = '%d' WHERE `Korisnik` = '%s'", GetPlayerMoney(playerid), GetPlayerScore(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pWarns], mysql_get_name(playerid));
  145.         mysql_query(Query);
  146.     }
  147.     return 1;
  148. }
  149.  
  150. public OnPlayerSpawn(playerid)
  151. {
  152.     SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  153.     return 1;
  154. }
  155.  
  156. public OnPlayerDeath(playerid, killerid, reason)
  157. {
  158.     return 1;
  159. }
  160.  
  161. public OnPlayerText(playerid, text[])
  162. {
  163.     if(rBit1_Get(PlayerMuted, playerid))
  164.     {
  165.         SendClientMessage(playerid, COLOR_YELLOW, "* You can't talk, you are muted!");
  166.         return 0;
  167.     }
  168.     if(IsChatOnOrOff == 1)
  169.     {
  170.         SendClientMessage(playerid, COLOR_YELLOW, "* You can't talk, chat is turned off!");
  171.         return 0;
  172.     }
  173.     return 1;
  174. }
  175.  
  176. public OnPlayerCommandText(playerid, cmdtext[])
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  182. {
  183.     return 1;
  184. }
  185.  
  186. public OnPlayerExitVehicle(playerid, vehicleid)
  187. {
  188.     return 1;
  189. }
  190.  
  191. public OnPlayerStateChange(playerid, newstate, oldstate)
  192. {
  193.     return 1;
  194. }
  195.  
  196. public OnPlayerPickUpPickup(playerid, pickupid)
  197. {
  198.     return 1;
  199. }
  200.  
  201. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  202. {
  203.     return 1;
  204. }
  205.  
  206. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  207. {
  208.     return 1;
  209. }
  210.  
  211. public OnPlayerUpdate(playerid)
  212. {
  213.     return 1;
  214. }
  215.  
  216. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  217. {
  218.     switch(dialogid)
  219.     {
  220.         case 1:
  221.         {
  222.             if(!strlen(inputtext))
  223.             {
  224.                 format(title, sizeof(title), "{00CCFF}     Welcome{FFFFFF} %s!", GetName(playerid));
  225.                 format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is not registered!\nRegister!", GetName(playerid));
  226.                 ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT , title, text2, "Ok", "Exit");
  227.             }
  228.             new password[100];
  229.             mysql_real_escape_string(inputtext, password);
  230.             format(Query, sizeof(Query), "INSERT INTO `users` (User, Password, Money, Score, Kills, Deaths, Admin, Warns, IP) VALUES('%s', '%s', 0, 0, 0, 0, 0, 0, '%s')", mysql_get_name(playerid), password, GetIP(playerid));
  231.             mysql_query(Query);
  232.             rBit1_Set(IsPlayerLogged, playerid, 1);
  233.             format(string, sizeof(string), "You have registered with name {FFFFFF}'%s' {FFFF00}and password {FFFFFF}'%s'{FFFF00}!", GetName(playerid), inputtext);
  234.             SendClientMessage(playerid, COLOR_YELLOW, string);
  235.         }
  236.         case 2:
  237.         {
  238.             if(!response) return Kick(playerid);
  239.             new password[128], savingstring[1000];
  240.             mysql_real_escape_string(inputtext, password);
  241.             format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `User` = '%s' AND `Password` = '%s' LIMIT 1", mysql_get_name(playerid), password);
  242.             mysql_query(Query);
  243.             mysql_store_result();
  244.             if(mysql_num_rows() == 0)
  245.             {
  246.                 SetPVarInt(playerid, "WrongPass", GetPVarInt(playerid, "WrongPass") + 1);
  247.                 format(title, sizeof(title), "{00CCFF}     Welcome{FFFFFF} %s!", GetName(playerid));
  248.                 format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is registered!\nLogin!\n\n{F81414}You typed wrong password!", GetName(playerid));
  249.                 ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT , title, text2, "Ok", "Izlaz");
  250.                 if(GetPVarInt(playerid, "WrongPass") == 3)
  251.                 {
  252.                     format(string, sizeof(string), "Server: {F81414}%s is kicked from server! Reason: 3 times typed wrong password!", GetName(playerid));
  253.                     SendClientMessageToAll(COLOR_WHITE, string);
  254.                 }
  255.             }
  256.             else
  257.             {
  258.                 if(mysql_fetch_row_format(Query, "|"))
  259.                 {
  260.                     rBit1_Set(IsPlayerLogged, playerid, 1);
  261.                     mysql_fetch_field_row(savingstring, "Money"); PlayerInfo[playerid][pMoney] = strval(savingstring);
  262.                     mysql_fetch_field_row(savingstring, "Score"); PlayerInfo[playerid][pScore] = strval(savingstring);
  263.                     mysql_fetch_field_row(savingstring, "Kills"); PlayerInfo[playerid][pKills] = strval(savingstring);
  264.                     mysql_fetch_field_row(savingstring, "Deaths"); PlayerInfo[playerid][pDeaths] = strval(savingstring);
  265.                     mysql_fetch_field_row(savingstring, "Admin"); PlayerInfo[playerid][pAdmin] = strval(savingstring);
  266.                     mysql_fetch_field_row(savingstring, "Warns"); PlayerInfo[playerid][pWarns] = strval(savingstring);
  267.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  268.                  }
  269.             }
  270.             mysql_free_result();
  271.         }
  272.         case 3:
  273.         {
  274.             if(!response) return 0;
  275.             format(string, sizeof(string), "* Player %s need help: %s", GetName(playerid), inputtext);
  276.             SendClientMessageToAdmins(COLOR_LIGHTBLUE, string);
  277.             SendClientMessage(playerid, COLOR_LIME, "* Your question has been sent to administrators!");
  278.         }
  279.         case 4:
  280.         {
  281.             if(!response) return 0;
  282.             switch(listitem)
  283.             {
  284.                 case 0:
  285.                 {
  286.                     ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Name", "Enter the ID of a player to whom you want to teleport!", "Ok", "Izlaz");
  287.                 }
  288.                 case 1:
  289.                 {
  290.                     if(Pos[0] == 0.0 && Pos[1] == 0.0 && Pos[2] == 0.0) return SendClientMessage(playerid, COLOR_WHITE, "* Type /setloc before teleporting!");
  291.                     else
  292.                     if(IsPlayerInAnyVehicle(playerid))
  293.                     {
  294.                         new VehicleID;
  295.                         VehicleID = GetPlayerVehicleID(playerid);
  296.                         SetVehiclePos(VehicleID, Pos[0], Pos[1], Pos[2]);
  297.                         SetPlayerFacingAngle(playerid, Pos[3]);
  298.                     }
  299.                     else
  300.                     {
  301.                         SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  302.                         SetPlayerFacingAngle(playerid, Pos[3]);
  303.                     }
  304.                     SendClientMessage(playerid, COLOR_YELLOW, "* You have been teleported to your last location!");
  305.                 }
  306.                 case 2:
  307.                 {
  308.                     SetPlayerInterior(playerid, 6);
  309.                     SetPlayerPos(playerid, 264.2483,77.5985,1001.0391);
  310.                     SendClientMessage(playerid, COLOR_YELLOW, "* You have been teleported to the jail!");
  311.                 }
  312.             }
  313.         }
  314.         case 5:
  315.         {
  316.             if(!response) return 0;
  317.             if(strval(inputtext) == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  318.             else if(strval(inputtext) == playerid) return SendClientMessage(playerid, COLOR_WHITE, "You can't teleport to your self!");
  319.             GetPlayerPos(strval(inputtext), Pos[0], Pos[1], Pos[2]);
  320.             SetPlayerPosWithVehicle(playerid, Pos[0] + 2, Pos[1] + 2, Pos[2]);
  321.             format(string, sizeof(string), "* You have teleported to player %s!", GetName(strval(inputtext)));
  322.             SendClientMessage(playerid, COLOR_YELLOW, string);
  323.         }
  324.         case 9:
  325.         {
  326.             if(!response) return 0;
  327.             switch(listitem)
  328.             {
  329.                 case 0:
  330.                 {
  331.                     ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
  332.                 }
  333.                 case 1:
  334.                 {
  335.                     ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
  336.                 }
  337.             }
  338.         }
  339.         case 10:
  340.         {
  341.             if(!response) return 0;
  342.             switch(listitem)
  343.             {
  344.                 case 0:
  345.                 {
  346.                     ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
  347.                 }
  348.                 case 1:
  349.                 {
  350.                     ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
  351.                 }
  352.                 case 2:
  353.                 {
  354.                     ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of score that you want to set!", "Ok", "Exit");
  355.                 }
  356.                 case 3:
  357.                 {
  358.                     ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of money that you want to give!", "Ok", "Exit");
  359.                 }
  360.             }
  361.         }
  362.         case 11:
  363.         {
  364.             if(!response) return 0;
  365.             switch(listitem)
  366.             {  
  367.                 case 0:
  368.                 {
  369.                     ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
  370.                 }
  371.                 case 1:
  372.                 {
  373.                     ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
  374.                 }
  375.                 case 2:
  376.                 {
  377.                     ShowPlayerDialog(playerid, 19, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of money that you want to set!", "Ok", "Exit");
  378.                 }
  379.                 case 3:
  380.                 {
  381.                     ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of score that you want to set!", "Ok", "Exit");
  382.                 }
  383.                 case 4:
  384.                 {
  385.                     ShowPlayerDialog(playerid, 16, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of kills that you want to set!", "Ok", "Exit");
  386.                 }
  387.                 case 5:
  388.                 {
  389.                     ShowPlayerDialog(playerid, 17, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of deaths that you want to set!", "Ok", "Exit");
  390.                 }
  391.                 case 6:
  392.                 {
  393.                     ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, "   Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
  394.                 }
  395.                 case 7:
  396.                 {
  397.                     ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of money that you want to give!", "Ok", "Exit");
  398.                 }
  399.             }
  400.         }
  401.         case 12:
  402.         {
  403.             if(!response) return 0;
  404.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
  405.             if(strlen(inputtext) < 0 || strlen(inputtext) > 100)
  406.             {
  407.                 ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
  408.                 SendClientMessage(playerid, COLOR_WHITE, "Health must be beetwen 0 & 100");
  409.             }
  410.             SetPlayerHealth(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
  411.             format(string, sizeof(string), "* You set player %s health on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  412.             SendClientMessage(playerid, COLOR_YELLOW, string);
  413.             format(string2, sizeof(string), "* Administrator %s has set your health!", GetName(playerid));
  414.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  415.         }
  416.         case 13:
  417.         {
  418.             if(!response) return 0;
  419.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
  420.             if(strlen(inputtext) < 0 || strlen(inputtext) > 100)
  421.             {
  422.                 ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
  423.                 SendClientMessage(playerid, COLOR_WHITE, "Armour must be beetwen 0 & 100");
  424.             }
  425.             SetPlayerArmour(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
  426.             format(string, sizeof(string), "* You set player %s armour on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  427.             SendClientMessage(playerid, COLOR_YELLOW, string);
  428.             format(string2, sizeof(string), "* Administrator %s has set your armour!", GetName(playerid));
  429.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  430.         }
  431.         case 14:
  432.         {
  433.             if(!response) return 0;
  434.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of score that you want to set!", "Ok", "Exit");
  435.             PlayerInfo[GetPVarInt(playerid, "SelectedID")][pScore] = strval(inputtext);
  436.             SetPlayerScore(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
  437.             format(Query, sizeof(Query), "UPDATE `users` SET `Score` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
  438.             mysql_query(Query);
  439.             format(string, sizeof(string), "* You set player %s score on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  440.             SendClientMessage(playerid, COLOR_YELLOW, string);
  441.             format(string2, sizeof(string2), "* Administrator %s has set your score on %d!", GetName(playerid), strval(inputtext));
  442.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  443.         }
  444.         case 15:
  445.         {
  446.             if(!response) return 0;
  447.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of money that you want to give!", "Ok", "Exit");
  448.             PlayerInfo[GetPVarInt(playerid, "SelectedID")][pMoney] += strval(inputtext);
  449.             GivePlayerMoney(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
  450.             format(Query, sizeof(Query), "UPDATE `users` SET `Money` = '%d' WHERE `User` = '%s'", PlayerInfo[GetPVarInt(playerid, "SelectedID")][pMoney], mysql_get_name(GetPVarInt(playerid, "SelectedID")));
  451.             mysql_query(Query);
  452.             format(string, sizeof(string), "* You give player %s $%d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  453.             SendClientMessage(playerid, COLOR_YELLOW, string);
  454.             format(string2, sizeof(string2), "* Administrator %s has give you $%d!", GetName(playerid), strval(inputtext));
  455.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  456.         }
  457.         case 16:
  458.         {
  459.             if(!response) return 0;
  460.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 16, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of kills that you want to set!", "Ok", "Exit");
  461.             PlayerInfo[GetPVarInt(playerid, "SelectedID")][pKills] = strval(inputtext);
  462.             format(Query, sizeof(Query), "UPDATE `users` SET `Kills` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
  463.             mysql_query(Query);
  464.             format(string, sizeof(string), "* You set player %s kills on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  465.             SendClientMessage(playerid, COLOR_YELLOW, string);
  466.             format(string2, sizeof(string2), "* Administrator %s has set your kills on %d!", GetName(playerid), strval(inputtext));
  467.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  468.         }
  469.         case 17:
  470.         {
  471.             if(!response) return 0;
  472.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 17, DIALOG_STYLE_INPUT, "   Ammount", "Type an ammount of deaths that you want to set!", "Ok", "Exit");
  473.             PlayerInfo[GetPVarInt(playerid, "SelectedID")][pDeaths] = strval(inputtext);
  474.             format(Query, sizeof(Query), "UPDATE `users` SET `Deaths` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
  475.             mysql_query(Query);
  476.             format(string, sizeof(string), "* You set player %s deaths on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  477.             SendClientMessage(playerid, COLOR_YELLOW, string);
  478.             format(string2, sizeof(string2), "* Administrator %s has set your deaths on %d!", GetName(playerid), strval(inputtext));
  479.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  480.         }
  481.         case 18:
  482.         {
  483.             if(!response) return 0;
  484.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, "   Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
  485.             if(strlen(inputtext) < 0 || strlen(inputtext) > 3)
  486.             {
  487.                 ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, "   Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
  488.                 SendClientMessage(playerid, COLOR_WHITE, "Level must be beetwen 0 & 3");
  489.             }
  490.             PlayerInfo[GetPVarInt(playerid, "SelectedID")][pAdmin] = strval(inputtext);
  491.             format(Query, sizeof(Query), "UPDATE `users` SET `Admin` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
  492.             mysql_query(Query);
  493.             format(string, sizeof(string), "* You set palyer %s administrator level on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  494.             SendClientMessage(playerid, COLOR_YELLOW, string);
  495.             format(string2, sizeof(string2), "* Administrator %s has set your administrator level on %d!", GetName(playerid), strval(inputtext));
  496.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  497.         }
  498.         case 19:
  499.         {
  500.             if(!response) return 0;
  501.             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, "   Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
  502.             PlayerInfo[GetPVarInt(playerid, "SelectedID")][pMoney] = strval(inputtext);
  503.             ResetPlayerMoney(GetPVarInt(playerid, "SelectedID"));
  504.             GivePlayerMoney(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
  505.             format(Query, sizeof(Query), "UPDATE `users` SET `Money` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
  506.             mysql_query(Query);
  507.             format(string, sizeof(string), "* You set player %s money on $%d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
  508.             SendClientMessage(playerid, COLOR_YELLOW, string);
  509.             format(string2, sizeof(string2), "* Administrator %s has set your money on %$d!", GetName(playerid), strval(inputtext));
  510.             SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
  511.         }
  512.     }
  513.     return 1;
  514. }
  515.  
  516. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  517. {
  518.     return 1;
  519. }
  520.  
  521. /*=================================================Commands=================================================*/
  522. YCMD:help(playerid, params[], help)
  523. {
  524.     #pragma unused help
  525.     #pragma unused params
  526.     ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Help!","{F81414}Commands\n\n\n{00C0FF}/stats /vcolor /v /report /new /report /pay /kill /refresh /admins", "Ok", "");
  527.     return 1;
  528. }
  529.  
  530. YCMD:stats(playerid, params[], help)
  531. {
  532.     #pragma unused help
  533.     #pragma unused params
  534.     new largestring[400];
  535.     format(largestring, sizeof(largestring), "Money: %d\nScore: %d\nKills: %d\nDeaths: %d\nWarns: %d", GetPlayerMoney(playerid), GetPlayerScore(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pWarns]);
  536.     ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, "   Your stats", largestring, "Ok", "");
  537.     return 1;
  538. }
  539.  
  540. YCMD:vcolor(playerid, params[], help)
  541. {
  542.     #pragma unused help
  543.     new color, color2, vehicleid = GetPlayerVehicleID(playerid);
  544.     if(rBit1_Get(InJailZone, playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "* You can't use commands in Color!");
  545.     if(sscanf(params, "ii", color, color2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /vcolor [Color 1] [Boja 2]");
  546.     else if(color < 0 || color > 252 || color2 < 0 || color2 > 252) return SendClientMessage(playerid, COLOR_WHITE, "* Color must be beetwen 0 & 252!");
  547.     else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "* You must be in a vehicle!");
  548.     else ChangeVehicleColor(vehicleid, color, color2);
  549.     return 1;
  550. }
  551.  
  552. YCMD:v(playerid, params[], help)
  553. {
  554.     #pragma unused help
  555.     new vname[128];
  556.     if(sscanf(params, "s[128]", vname)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /v [Vehicle Name]");
  557.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "* You are already in a vehicle!");
  558.     CreateVehicleForPlayer(playerid, vname, -1, -1);
  559.     return 1;
  560. }
  561.  
  562. YCMD:report(playerid, params[], help)
  563. {
  564.     #pragma unused help
  565.     new id, reason[128];
  566.     if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /report [ID][Reason]");
  567.     else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  568.     else
  569.     format(string, sizeof(string), "* Player %s is reporting player %s: %s", GetName(playerid), GetName(id), reason);
  570.     SendClientMessageToAdmins(COLOR_YELLOW, string);
  571.     SendClientMessage(playerid, COLOR_LIME, "* Your report has been sent to administrators!");
  572.     return 1;
  573. }
  574.  
  575. YCMD:new(playerid, params[], help)
  576. {
  577.     #pragma unused help
  578.     #pragma unused params
  579.     ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Help!", "Type question for administrators!", "Ok", "Exit");
  580.     return 1;
  581. }
  582.  
  583. YCMD:pay(playerid, params[], help)
  584. {
  585.     #pragma unused help
  586.     new id, ammount;
  587.     if(rBit1_Get(InJailZone, playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "* You can't use commands in jail!");
  588.     if(sscanf(params, "ui", id, ammount)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /pay [ID][Ammount]");
  589.     else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  590.     if(ammount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You don't have too much money!");
  591.     if(ammount < 1) return SendClientMessage(playerid, COLOR_GREEN, "* Ammount must be higher than 0!");
  592.     else
  593.     GivePlayerMoney(id, ammount);
  594.     GivePlayerMoney(playerid, -ammount);
  595.     format(string, sizeof(string), "* You give player %s $%d!", GetName(id), ammount);
  596.     SendClientMessage(playerid, COLOR_YELLOW, string);
  597.     format(string2, sizeof(string2), "* Player %s has gave you $%d!", GetName(playerid), ammount);
  598.     SendClientMessage(id, COLOR_LIME, string2);
  599.     return 1;
  600. }
  601.  
  602. YCMD:kill(playerid, params[], help)
  603. {
  604.     #pragma unused help
  605.     #pragma unused params
  606.     SetPlayerHealth(playerid, 0.0);
  607.     return 1;
  608. }
  609.  
  610. YCMD:refresh(playerid, params[], help)
  611. {
  612.     #pragma unused help
  613.     #pragma unused params
  614.     SetPlayerVirtualWorld(playerid, 0);
  615.     SetPlayerInterior(playerid, 0);
  616.     SendClientMessage(playerid, COLOR_LIME, "* You are refreshed, if you still have problems contact an administrators!");
  617.     return 1;
  618. }
  619.  
  620. YCMD:admins(playerid, params[], help)
  621. {
  622.     #pragma unused help
  623.     #pragma unused params
  624.     SendClientMessage(playerid, COLOR_KRED, "<~~ Administratori Online ~~>");
  625.     foreach(Player, i)
  626.     if(PlayerInfo[i][pAdmin] == 1)
  627.     {
  628.         format(string, sizeof(string), "%s (Gamemaster)", GetName(i));
  629.         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  630.     }
  631.     else if(PlayerInfo[i][pAdmin] == 2)
  632.     {
  633.         format(string, sizeof(string), "%s (Administrator)", GetName(i));
  634.         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  635.     }
  636.     else if(PlayerInfo[i][pAdmin] == 3)
  637.     {
  638.         format(string, sizeof(string), "%s (Head)", GetName(i));
  639.         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  640.     }
  641.     return 1;
  642. }
  643. /*================================================Admin Commands================================================*/
  644.  
  645. YCMD:slap(playerid, params[], help)
  646. {
  647.     #pragma unused help
  648.     new id;
  649.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  650.     {
  651.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /slap [ID]");
  652.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  653.         else
  654.         GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
  655.         SetPlayerPos(id, Pos[0], Pos[1], Pos[2] + 8);
  656.         format(string,sizeof(string), "* You slaped %s!", GetName(id));
  657.         SendClientMessage(playerid, COLOR_YELLOW, string);
  658.         format(string2, sizeof(string2), "* Administrator %s has slaped you!", GetName(playerid));
  659.         SendClientMessage(id, COLOR_LIME, string2);
  660.     }
  661.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  662.     return 1;
  663. }
  664.  
  665. YCMD:explode(playerid, params[], help)
  666. {
  667.     #pragma unused help
  668.     new id;
  669.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  670.     {
  671.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /explode [ID]");
  672.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  673.         else
  674.         GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
  675.         CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 1);
  676.         CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 1);
  677.         CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 1);
  678.         format(string, sizeof(string), "* You exploded player %s!", GetName(id));
  679.         SendClientMessage(playerid, COLOR_YELLOW, string);
  680.         format(string2, sizeof(string2), "* You explode by administrator %s!", GetName(playerid));
  681.         SendClientMessage(id, COLOR_LIME, string2);
  682.  
  683.     }
  684.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  685.     return 1;
  686. }
  687.  
  688. YCMD:mute(playerid, params[], help)
  689. {
  690.     #pragma unused help
  691.     new id, time, reason[128];
  692.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  693.     {
  694.         if(sscanf(params, "uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /mute [ID][Time][Reason]");
  695.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  696.         else
  697.         if(rBit1_Get(PlayerMuted, id)) return SendClientMessage(playerid, COLOR_YELLOW, "* Player is already muted!");
  698.         rBit1_Set(PlayerMuted, id, 1);
  699.         MuteTimer[id] = SetTimerEx("UnMute", time*1000*60, 0, "d", id);
  700.         format(string, sizeof(string), "* You muted player %s on %d minutes!", GetName(id), time);
  701.         SendClientMessage(playerid, COLOR_YELLOW, string);
  702.         format(string2, sizeof(string2), "* You are muted by administrator %s on %d minutes! Reason: %s", GetName(playerid), time, reason);
  703.         SendClientMessage(id, COLOR_LIME, string2);
  704.     }
  705.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  706.     return 1;
  707. }
  708.  
  709. YCMD:unmute(playerid, params[], help)
  710. {
  711.     #pragma unused help
  712.     new id;
  713.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  714.     {
  715.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unmute [ID]");
  716.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  717.         else
  718.         if(!rBit1_Get(PlayerMuted, id)) return SendClientMessage(playerid, COLOR_KRED, "* Player isn't muted!");
  719.         rBit1_Set(PlayerMuted, id, 0);
  720.         KillTimer(MuteTimer[id]);
  721.         format(string, sizeof(string), "* You unmuted player %s!", GetName(id));
  722.         SendClientMessage(playerid, COLOR_YELLOW, string);
  723.         format(string2, sizeof(string2), "* You are unmuted by administrator %s!", GetName(playerid));
  724.         SendClientMessage(id, COLOR_LIME, string2);
  725.     }
  726.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  727.     return 1;
  728. }
  729.  
  730. YCMD:freeze(playerid, params[], help)
  731. {
  732.     #pragma unused help
  733.     new id;
  734.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  735.     {
  736.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /freeze [ID]");
  737.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  738.         else
  739.         if(rBit1_Get(IsPlayerFreezed, id)) return SendClientMessage(playerid, COLOR_WHITE, "Player is already freezed!");
  740.         TogglePlayerControllable(id, 0);
  741.         rBit1_Set(IsPlayerFreezed, id, 1);
  742.         format(string, sizeof(string), "* You freezed player %s", GetName(id));
  743.         SendClientMessage(playerid, COLOR_YELLOW, string);
  744.         format(string2, sizeof(string2), "* Administrator %s has freezed you!", GetName(playerid));
  745.         SendClientMessage(id, COLOR_LIME, string2);
  746.     }
  747.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  748.     return 1;
  749. }
  750.  
  751. YCMD:unfreeze(playerid, params[], help)
  752. {
  753.     #pragma unused help
  754.     new id;
  755.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  756.     {
  757.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unfreeze [ID]");
  758.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  759.         else
  760.         if(!rBit1_Get(IsPlayerFreezed, id)) return SendClientMessage(playerid, COLOR_WHITE, "Player isn't freezed!");
  761.         TogglePlayerControllable(id, 1);
  762.         rBit1_Set(IsPlayerFreezed, id, 0);
  763.         format(string, sizeof(string), "* You unfreezed palyer %s", GetName(id));
  764.         SendClientMessage(playerid, COLOR_YELLOW, string);
  765.         format(string2, sizeof(string2), "* Administrator %s has unfreezed you!", GetName(playerid));
  766.         SendClientMessage(id, COLOR_LIME, string2);
  767.     }
  768.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  769.     return 1;
  770. }
  771.  
  772. YCMD:crash(playerid, params[], help)
  773. {
  774.     #pragma unused help
  775.     new id;
  776.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  777.     {
  778.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /crash [ID]");
  779.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  780.         else
  781.         GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
  782.         CreatePlayerObject(id, 385, Pos[0], Pos[1], Pos[2], 0, 0, 0);
  783.         format(string, sizeof(string), "* You crashed player %s", GetName(id));
  784.         SendClientMessage(playerid, COLOR_RED, string);
  785.     }
  786.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  787.     return 1;
  788. }
  789.  
  790. YCMD:jail(playerid, params[], help)
  791. {
  792.     #pragma unused help
  793.     new id, time, reason[128];
  794.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  795.     {
  796.         if(sscanf(params, "uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /jail [ID][Time][Reason]");
  797.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  798.         else
  799.         if(rBit1_Get(InJailZone, id)) return SendClientMessage(playerid, COLOR_YELLOW, "Player is already in jail!");
  800.         rBit1_Set(InJailZone, id, 1);
  801.         SetPlayerInterior(id, 6);
  802.         SetPlayerPos(id, 264.2483,77.5985,1001.03914);
  803.         JailTimer[id] = SetTimerEx("UnJail", time*1000*60, 0, "d", id);
  804.         format(string, sizeof(string), "* You put player %s in the jail on %d minutes!", GetName(id), time);
  805.         SendClientMessage(playerid, COLOR_YELLOW, string);
  806.         format(string2, sizeof(string2), "* Administrator %s has put you in the jail on %d minutes! Reason: %s", GetName(playerid), time, reason);
  807.         SendClientMessage(id, COLOR_LIME, string2);
  808.     }
  809.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  810.     return 1;
  811. }
  812.  
  813. YCMD:unjail(playerid, params[], help)
  814. {
  815.     #pragma unused help
  816.     new id;
  817.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  818.     {
  819.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unjail [ID]");
  820.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  821.         else
  822.         if(!rBit1_Get(InJailZone, id)) return SendClientMessage(playerid, COLOR_YELLOW, "Igrač nije u zatvoru!");
  823.         rBit1_Set(InJailZone, id, 0);
  824.         SetPlayerInterior(id, 0);
  825.         SpawnPlayer(id);
  826.         KillTimer(JailTimer[id]);
  827.         format(string, sizeof(string), "* You unjailed player %s iz zatvora!", GetName(id));
  828.         SendClientMessage(playerid, COLOR_YELLOW, string);
  829.         format(string2, sizeof(string2), "* Administrator %s has unjailed you!", GetName(playerid));
  830.         SendClientMessage(id, COLOR_LIME, string2);
  831.     }
  832.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  833.     return 1;
  834. }
  835.  
  836. YCMD:kick(playerid, params[], help)
  837. {
  838.     #pragma unused help
  839.     new id, reason[128];
  840.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  841.     {
  842.         if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kick [ID][Reason]");
  843.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  844.         else
  845.         TogglePlayerControllable(id, 0);
  846.         format(string, sizeof(string), "** Server: {F81414}%s is kicked from server by administator %s! Reason: %s!", GetName(id), GetName(playerid), reason);
  847.         SendClientMessageToAll(COLOR_WHITE, string);
  848.         Kick(id);
  849.     }
  850.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  851.     return 1;
  852. }
  853.  
  854. YCMD:warn(playerid, params[], help)
  855. {
  856.     #pragma unused help
  857.     new id, percentage, reason[128], string3[128];
  858.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  859.     {
  860.         if(sscanf(params, "us[128]i", id, reason, percentage)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /warn [ID][Reason][Percentage]");
  861.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  862.         else if(percentage > 100 || percentage < 1) return SendClientMessage(playerid, COLOR_WHITE, "Percentage must be beetwen 1 & 100!");
  863.         else
  864.         PlayerInfo[id][pWarns] = PlayerInfo[id][pWarns] + percentage;
  865.         format(Query, sizeof(Query), "UPDATE `users` SET `Warns` = '%d' WHERE `User` = '%s'", PlayerInfo[id][pWarns], mysql_get_name(id));
  866.         mysql_query(Query);
  867.         format(string, sizeof(string), "* You give player %s %d percentage of warnings!", GetName(id), percentage);
  868.         SendClientMessage(playerid, COLOR_YELLOW, string);
  869.         format(string2, sizeof(string2), "* Administrator %s has give %d percentage of warnings! Reason: %s", GetName(playerid), percentage, reason);
  870.         SendClientMessage(id, COLOR_LIME, string2);
  871.         if(PlayerInfo[id][pWarns] >= 100)
  872.         {
  873.             TogglePlayerControllable(id, 0);
  874.             format(string3, sizeof(string3), "** Server: {F81414}%s is banned from serve by administator %s! Reason: 100 percentage of warnings!", GetName(id), GetName(playerid));
  875.             SendClientMessageToAll(COLOR_WHITE, string3);
  876.             CustomBan(id, playerid, reason);
  877.         }
  878.     }
  879.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  880.     return 1;
  881. }
  882.  
  883. YCMD:ban(playerid, params[], help)
  884. {
  885.     #pragma unused help
  886.     new id, reason[128];
  887.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  888.     {
  889.         if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [ID][Razlog]");
  890.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  891.         else
  892.         TogglePlayerControllable(id, 0);
  893.         format(string, sizeof(string), "** Server: {F81414}%s is banned from serve by administator %s! Reason: %s!", GetName(id), GetName(playerid), reason);
  894.         SendClientMessageToAll(COLOR_WHITE, string);
  895.         ClearChatForPlayer(id);
  896.         format(string, sizeof(string), "Name: ~w~%s", GetName(id));
  897.         TextDrawSetString(BanName, string);
  898.         format(string, sizeof(string), "Administrator: ~w~%s", GetName(playerid));
  899.         TextDrawSetString(BanAdministrator, string);
  900.         format(string, sizeof(string), "Reason: ~w~%s", reason);
  901.         TextDrawSetString(BanReason, string);
  902.         TextDrawShowForPlayer(id, BanBox);
  903.         TextDrawShowForPlayer(id, BanName);
  904.         TextDrawShowForPlayer(id, BanAdministrator);
  905.         TextDrawShowForPlayer(id, BanReason);
  906.         CustomBan(id, playerid, reason);
  907.     }
  908.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  909.     return 1;
  910. }
  911.  
  912. YCMD:unban(playerid, params[], help)
  913. {
  914.     #pragma unused help
  915.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
  916.     {
  917.         if(isnull(params) || strlen(params) > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [Ime]");
  918.         format(Query, sizeof(Query), "SELECT Banned FROM `bans` WHERE `Banned` = '%s' LIMIT 1", params);
  919.         mysql_query(Query);
  920.         mysql_store_result();
  921.         if(mysql_num_rows() == 0) return SendClientMessage(playerid, COLOR_WHITE, "Invalid name!");
  922.         CustomUnban(params);
  923.         format(string, sizeof(string), "* You unbanned player %s", params);
  924.         SendClientMessage(playerid, COLOR_YELLOW, string);
  925.         mysql_free_result();
  926.     }
  927.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  928.     return 1;
  929. }
  930.  
  931. YCMD:goto(playerid, params[], help)
  932. {
  933.     #pragma unused help
  934.     #pragma unused params
  935.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  936.     {
  937.         ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Goto", "Player\nLast saved position\nJail", "Ok", "Exit");
  938.     }
  939.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  940.     return 1;
  941. }
  942.  
  943. YCMD:gethere(playerid, params[], help)
  944. {
  945.     #pragma unused help
  946.     new id;
  947.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  948.     {
  949.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /gethere [ID]");
  950.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  951.         else if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE, "* You can't teleport you to you!");
  952.         else
  953.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  954.         SetPlayerPos(id, Pos[0] + 2, Pos[1] + 2, Pos[2]);
  955.         SetPlayerInterior(id, GetPlayerInterior(playerid));
  956.         SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
  957.         format(string, sizeof(string), "* You teleported %s to you!", GetName(id));
  958.         SendClientMessage(playerid, COLOR_YELLOW, string);
  959.         format(string2, sizeof(string2), "* Administrator %s has teleported you to him!", GetName(playerid));
  960.         SendClientMessage(id, COLOR_LIME, string2);
  961.     }
  962.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  963.     return 1;
  964. }
  965.  
  966. YCMD:setloc(playerid, params[], help)
  967. {
  968.     #pragma unused help
  969.     #pragma unused params
  970.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  971.     {
  972.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  973.         GetPlayerFacingAngle(playerid, Pos[3]);
  974.         SendClientMessage(playerid, COLOR_YELLOW, "* You possition is saved!");
  975.     }
  976.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  977.     return 1;
  978. }
  979.  
  980. YCMD:givegun(playerid, params[], help)
  981. {
  982.     #pragma unused help
  983.     new id, weaponid, ammo;
  984.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  985.     {
  986.         if(sscanf(params, "uii", id, weaponid, ammo)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /givegun [ID][Gun ID][Ammo]");
  987.         else if(weaponid > 46 || weaponid < 1) return SendClientMessage(playerid, COLOR_WHITE, "* Gun ID must be beetwen 1 & 46!");
  988.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  989.         else
  990.         GivePlayerWeapon(id, weaponid, ammo);
  991.         format(string, sizeof(string), "* You give player %s weapon %s!", GetName(id), GetWeapon(weaponid));
  992.         SendClientMessage(playerid, COLOR_YELLOW, string);
  993.         format(string2 ,sizeof(string2), "* Administrator %s has give you weapon %s!", GetName(playerid), GetWeapon(weaponid));
  994.         SendClientMessage(id, COLOR_LIME, string2);
  995.     }
  996.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  997.     return 1;
  998. }
  999.  
  1000. YCMD:weaponid(playerid, params[], help)
  1001. {
  1002.     #pragma unused help
  1003.     #pragma unused params
  1004.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1005.     {
  1006.         SendClientMessage(playerid,COLOR_WHITE,"----------------------------------WEAPON ID'S----------------------------------------");
  1007.         SendClientMessage(playerid,COLOR_ORANGE,"ID 1 || Brass Knuckles ");
  1008.         SendClientMessage(playerid,COLOR_ORANGE,"ID 2 || Golf Club");
  1009.         SendClientMessage(playerid,COLOR_ORANGE,"ID 3 || Nite Stick");
  1010.         SendClientMessage(playerid,COLOR_ORANGE,"ID 4 || Knife");
  1011.         SendClientMessage(playerid,COLOR_ORANGE,"ID 5 || Baseball Bat");
  1012.         SendClientMessage(playerid,COLOR_ORANGE,"ID 6 || Shovel");
  1013.         SendClientMessage(playerid,COLOR_ORANGE,"ID 7 || Pool Cue");
  1014.         SendClientMessage(playerid,COLOR_ORANGE,"ID 8 || Katana");
  1015.         SendClientMessage(playerid,COLOR_ORANGE,"ID 9 || Chainsaw");
  1016.         SendClientMessage(playerid,COLOR_ORANGE,"ID 10 || Purple Dildo");
  1017.         SendClientMessage(playerid,COLOR_ORANGE,"ID 11 || Small White Vibrator");
  1018.         SendClientMessage(playerid,COLOR_ORANGE,"ID 12 || Large White Vibrator");
  1019.         SendClientMessage(playerid,COLOR_ORANGE,"ID 13 || Silver Vibrator");
  1020.         SendClientMessage(playerid,COLOR_ORANGE,"ID 14 || Flowers");
  1021.         SendClientMessage(playerid,COLOR_ORANGE,"ID 15 || Cane");
  1022.         SendClientMessage(playerid,COLOR_ORANGE,"ID 16 || Grenade");
  1023.         SendClientMessage(playerid,COLOR_ORANGE,"ID 17 || Tear Gas");
  1024.         SendClientMessage(playerid,COLOR_ORANGE,"ID 18 || Molotov Cocktail");
  1025.         SendClientMessage(playerid,COLOR_ORANGE,"ID 22 || 9mm");
  1026.         SendClientMessage(playerid,COLOR_ORANGE,"ID 23 || Silenced 9mm");
  1027.         SendClientMessage(playerid,COLOR_ORANGE,"ID 24 || Desert Eagle");
  1028.         SendClientMessage(playerid,COLOR_ORANGE,"ID 25 || Shotgun");
  1029.         SendClientMessage(playerid,COLOR_ORANGE,"ID 26 || Sawn-off Shotgun");
  1030.         SendClientMessage(playerid,COLOR_ORANGE,"ID 27 || Combat Shotgun");
  1031.         SendClientMessage(playerid,COLOR_ORANGE,"ID 28 || Micro SMG");
  1032.         SendClientMessage(playerid,COLOR_ORANGE,"ID 29 || MP5");
  1033.         SendClientMessage(playerid,COLOR_ORANGE,"ID 30 || AK-47");
  1034.         SendClientMessage(playerid,COLOR_ORANGE,"ID 31 || M4");
  1035.         SendClientMessage(playerid,COLOR_ORANGE,"ID 32 || Tec9");
  1036.         SendClientMessage(playerid,COLOR_ORANGE,"ID 33 || Country Rifle");
  1037.         SendClientMessage(playerid,COLOR_ORANGE,"ID 34 || Sniper Rifle");
  1038.         SendClientMessage(playerid,COLOR_ORANGE,"ID 35 || Rocket Launcher");
  1039.         SendClientMessage(playerid,COLOR_ORANGE,"ID 36 || HS Rocket Launcher");
  1040.         SendClientMessage(playerid,COLOR_ORANGE,"ID 37 || Flamethrower");
  1041.         SendClientMessage(playerid,COLOR_ORANGE,"ID 38 || Minigun");
  1042.         SendClientMessage(playerid,COLOR_ORANGE,"ID 39 || Satchel Charge");
  1043.         SendClientMessage(playerid,COLOR_ORANGE,"ID 40 || Detonator");
  1044.         SendClientMessage(playerid,COLOR_ORANGE,"ID 41 || Spraycan");
  1045.         SendClientMessage(playerid,COLOR_ORANGE,"ID 42 || Fire Extinguisher");
  1046.         SendClientMessage(playerid,COLOR_ORANGE,"ID 43 || Camera");
  1047.         SendClientMessage(playerid,COLOR_ORANGE,"ID 44 || Nightvision Goggles");
  1048.         SendClientMessage(playerid,COLOR_ORANGE,"ID 45 || Thermal Goggles");
  1049.         SendClientMessage(playerid,COLOR_ORANGE,"ID 46 || Parachute");
  1050.     }
  1051.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1052.     return 1;
  1053. }
  1054.  
  1055. YCMD:o(playerid, params[], help)
  1056. {
  1057.     #pragma unused help
  1058.     new text[128];
  1059.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1060.     {
  1061.         if(sscanf(params, "s[128]", text)) SendClientMessage(playerid, COLOR_WHITE, "Usage: /o [Text]");
  1062.         if(PlayerInfo[playerid][pAdmin] == 1) return format(string, sizeof(string), "{FF00EA}Gamemaster %s: %s", GetName(playerid), text);
  1063.         else if(PlayerInfo[playerid][pAdmin] == 2) return format(string, sizeof(string), "{FF00EA}Administrator %s: %s", GetName(playerid), text);
  1064.         else if(PlayerInfo[playerid][pAdmin] == 3) return format(string, sizeof(string), "{FF00EA}Head %s: %s", GetName(playerid), text);
  1065.         SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  1066.     }
  1067.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1068.     return 1;
  1069. }
  1070.  
  1071. YCMD:a(playerid, params[], help)
  1072. {
  1073.     #pragma unused help
  1074.     new text[128];
  1075.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1076.     {
  1077.         if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /a [Text]");
  1078.         if(PlayerInfo[playerid][pAdmin] == 1) return format(string, sizeof(string), "{FF00EA}Gamemaster %s: %s", GetName(playerid), text);
  1079.         else if(PlayerInfo[playerid][pAdmin] == 2) return format(string, sizeof(string), "{FF00EA}Administrator %s: %s", GetName(playerid), text);
  1080.         else if(PlayerInfo[playerid][pAdmin] == 3) return format(string, sizeof(string), "{FF00EA}Head %s: %s", GetName(playerid), text);
  1081.         SendClientMessageToAdmins(COLOR_WHITE, string);
  1082.     }
  1083.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1084.     return 1;
  1085. }
  1086.  
  1087. YCMD:chat(playerid, params[], help)
  1088. {
  1089.     #pragma unused help
  1090.     new chatOnOff;
  1091.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
  1092.     {
  1093.         if(sscanf(params, "i", chatOnOff)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /chat [0-1]");
  1094.         switch(chatOnOff)
  1095.         {
  1096.             case 0:
  1097.             {
  1098.                 IsChatOnOrOff = 0;
  1099.                 format(string, sizeof(string), "* Administrator %s has turned off chat!", GetName(playerid));
  1100.                 SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  1101.             }
  1102.             case 1:
  1103.             {
  1104.                 IsChatOnOrOff = 1;
  1105.                 format(string, sizeof(string), "* Administrator %s has turned on chat!", GetName(playerid));
  1106.                 SendClientMessageToAll(COLOR_LIGHTBLUE,string);
  1107.             }
  1108.         }
  1109.     }
  1110.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1111.     return 1;
  1112. }
  1113.  
  1114. YCMD:cc(playerid, params[], help)
  1115. {
  1116.     #pragma unused help
  1117.     #pragma unused params
  1118.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1119.     {
  1120.         ClearChat();
  1121.         format(string, sizeof(string), "* Administrator %s has clean the chat!", GetName(playerid));
  1122.         SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  1123.     }
  1124.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1125.     return 1;
  1126. }
  1127.  
  1128.  
  1129. YCMD:cnn(playerid, params[], help)
  1130. {
  1131.     #pragma unused help
  1132.     new type, text[128];
  1133.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1134.     {
  1135.         if(sscanf(params, "is[128]", type, text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cnn [Type][Text]");
  1136.         GameTextForAll(text, 3800, type);
  1137.     }
  1138.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1139.     return 1;
  1140. }
  1141.  
  1142. YCMD:scream(playerid, params[], help)
  1143. {
  1144.     #pragma unused help
  1145.     new text[128];
  1146.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
  1147.     {
  1148.         if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /scream [Text]");
  1149.         format(string, sizeof(string), "* %s: %s", GetName(playerid), text);
  1150.         SendClientMessageToAll(COLOR_KRED, string);
  1151.         SendClientMessageToAll(COLOR_YELLOW, string);
  1152.         SendClientMessageToAll(COLOR_GREEN, string);
  1153.         SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  1154.         SendClientMessageToAll(COLOR_GREY, string);
  1155.         SendClientMessageToAll(COLOR_BLUE, string);
  1156.     }
  1157.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1158.     return 1;
  1159. }
  1160.  
  1161. YCMD:uping(playerid, params[], help)
  1162. {
  1163.     #pragma unused help
  1164.     new newz;
  1165.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1166.     {
  1167.         if(sscanf(params, "i", newz)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /uping [High]");
  1168.         else if(newz > 20000 || newz < 1) return SendClientMessage(playerid, COLOR_WHITE, "* High must be beetwen 1 & 20000");
  1169.         else
  1170.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1171.         SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2] + newz);
  1172.         SendClientMessage(playerid, COLOR_YELLOW, "* You moved up!");
  1173.     }
  1174.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1175.     return 1;
  1176. }
  1177.  
  1178. YCMD:downing(playerid, params[], help)
  1179. {
  1180.     #pragma unused help
  1181.     new newz;
  1182.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1183.     {
  1184.         if(sscanf(params, "i", newz)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /downing [High]");
  1185.         else if(newz > 20000 || newz < 1) return SendClientMessage(playerid, COLOR_WHITE, "* High must be beetwen 1 & 20000");
  1186.         else
  1187.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1188.         SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2] - newz);
  1189.         SendClientMessage(playerid, COLOR_YELLOW, "* You moved down!");
  1190.     }
  1191.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1192.     return 1;
  1193. }
  1194.  
  1195. YCMD:godmodeon(playerid, params[], help)
  1196. {
  1197.     #pragma unused help
  1198.     #pragma unused params
  1199.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1200.     {
  1201.         SetPlayerHealth(playerid, 99999.0);
  1202.         SetPlayerArmour(playerid, 99999.0);
  1203.         SendClientMessage(playerid, COLOR_YELLOW, "* You use godmode!");
  1204.     }
  1205.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1206.     return 1;
  1207. }
  1208.  
  1209. YCMD:godmodeoff(playerid, params[], help)
  1210. {
  1211.     #pragma unused help
  1212.     #pragma unused params
  1213.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1214.     {
  1215.         SetPlayerHealth(playerid, 100.0);
  1216.         SetPlayerArmour(playerid, 0.0);
  1217.         SendClientMessage(playerid, COLOR_YELLOW, "* You don't use godmode!");
  1218.     }
  1219.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1220.     return 1;
  1221. }
  1222.  
  1223. YCMD:specon(playerid, params[], help)
  1224. {
  1225.     #pragma unused help
  1226.     new id;
  1227.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1228.     {
  1229.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /specon [ID]");
  1230.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1231.         else
  1232.         TogglePlayerSpectating(playerid, 1);
  1233.         PlayerSpectatePlayer(playerid, id);
  1234.         SetPlayerInterior(playerid, GetPlayerInterior(id));
  1235.         rBit1_Set(gSpectateID, id, 1);
  1236.         rBit1_Set(gSpectateType, playerid, 1);
  1237.     }
  1238.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1239.     return 1;
  1240. }
  1241.  
  1242. YCMD:specoff(playerid, params[], help)
  1243. {
  1244.     #pragma unused help
  1245.     #pragma unused params
  1246.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1247.     {
  1248.         TogglePlayerSpectating(playerid, 0);
  1249.         rBit16_Set(gSpectateID, playerid, 1);
  1250.         rBit1_Set(gSpectateType, playerid, 0);
  1251.     }
  1252.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1253.     return 1;
  1254. }
  1255.  
  1256. YCMD:vehid(playerid, params[], help)
  1257. {
  1258.     #pragma unused help
  1259.     #pragma unused params
  1260.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1261.     {
  1262.         if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
  1263.         format(string, sizeof(string), "* ID of this vehicle is: %d", GetPlayerVehicleID(playerid) - 400);
  1264.         SendClientMessage(playerid, COLOR_YELLOW, string);
  1265.     }
  1266.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1267.     return 1;
  1268. }
  1269.  
  1270. YCMD:remove(playerid, params[], help)
  1271. {
  1272.     #pragma unused help
  1273.     new id;
  1274.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1275.     {
  1276.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /remove [ID]");
  1277.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1278.         else
  1279.         if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not in a vehicle!");
  1280.         RemovePlayerFromVehicle(id);
  1281.         format(string, sizeof(string), "* You removed player %s from vehicle!", GetName(id));
  1282.         SendClientMessage(playerid, COLOR_YELLOW, string);
  1283.         format(string2, sizeof(string2), "* Administrator %s has removed you from vehicle!", GetName(playerid));
  1284.         SendClientMessage(id, COLOR_LIME, string2);
  1285.     }
  1286.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1287.     return 1;
  1288. }
  1289.  
  1290. YCMD:destroyveh(playerid, params[], help)
  1291. {
  1292.     #pragma unused help
  1293.     new vID;
  1294.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1295.     {
  1296.         if(sscanf(params, "i", vID))
  1297.         {
  1298.             SendClientMessage(playerid, COLOR_WHITE, "Usage: /destroyveh [ID]");
  1299.             SendClientMessage(playerid, COLOR_WHITE, "Type /vehid to see ID of this vehicle!");
  1300.             return 1;
  1301.         }
  1302.         RemovePlayerFromVehicle(playerid);
  1303.         DestroyVehicle(vID);
  1304.         format(string, sizeof(string), "* You deleted vehicle: %d", vID - 400);
  1305.         SendClientMessage(playerid, COLOR_YELLOW, string);
  1306.     }
  1307.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1308.     return 1;
  1309. }
  1310.  
  1311. YCMD:disarm(playerid, params[], help)
  1312. {
  1313.     #pragma unused help
  1314.     new id;
  1315.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1316.     {
  1317.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /disarm [ID]");
  1318.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1319.         else
  1320.         ResetPlayerWeapons(id);
  1321.         format(string, sizeof(string), "* You disarmed player %s!", GetName(id));
  1322.         SendClientMessage(playerid, COLOR_YELLOW, string);
  1323.         format(string2, sizeof(string2), "* Administrator %s has disarmed you!", GetName(playerid));
  1324.         SendClientMessage(id, COLOR_LIME, string2);
  1325.     }
  1326.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1327.     return 1;
  1328. }
  1329.  
  1330. YCMD:onduty(playerid, params[], help)
  1331. {
  1332.     #pragma unused help
  1333.     #pragma unused params
  1334.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1335.     {
  1336.         if(rBit1_Get(OnDuty, playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are already on a duty!");
  1337.         Duty[playerid] = Create3DTextLabel("Na dužnosti!", COLOR_LIME, 0, 0, 0, 50, -1, 1);
  1338.         Attach3DTextLabelToPlayer(Duty[playerid], playerid, 0, 0, 0);
  1339.         SetPlayerColor(playerid, COLOR_LIME);
  1340.         SetPlayerColor(playerid, COLOR_GREEN);
  1341.         SetPlayerHealth(playerid, 250);
  1342.         SetPlayerArmour(playerid, 250);
  1343.         format(string, sizeof(string), "* %s is now on duty!", GetName(playerid));
  1344.         SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  1345.         rBit1_Set(OnDuty, playerid, 1);
  1346.     }
  1347.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1348.     return 1;
  1349. }
  1350.  
  1351. YCMD:offduty(playerid, params[], help)
  1352. {
  1353.     #pragma unused help
  1354.     #pragma unused params
  1355.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
  1356.     {
  1357.         if(!rBit1_Get(OnDuty, playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not on a duty!");
  1358.         Delete3DTextLabel(Duty[playerid]);
  1359.         SetPlayerColor(playerid, COLOR_WHITE);
  1360.         SetPlayerHealth(playerid, 100);
  1361.         SetPlayerArmour(playerid, 0);
  1362.         format(string, sizeof(string), "* %s isn't on duty!", GetName(playerid));
  1363.         SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  1364.         rBit1_Set(OnDuty, playerid, 0);
  1365.     }
  1366.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1367.     return 1;
  1368. }
  1369.  
  1370. YCMD:editinfo(playerid, params[], help)
  1371. {
  1372.     #pragma unused help
  1373.     new id;
  1374.     if(PlayerInfo[playerid][pAdmin] == 1)
  1375.     {
  1376.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /editinfo [ID]");
  1377.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1378.         SetPVarInt(playerid, "SelectedID", id);
  1379.         format(title, sizeof(title), "   %s", GetName(id));
  1380.         ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, title, "Set health\nSet armour", "Ok", "Exit");
  1381.     }
  1382.     else if(PlayerInfo[playerid][pAdmin] == 2)
  1383.     {
  1384.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /editinfo [ID]");
  1385.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1386.         SetPVarInt(playerid, "SelectedID", id);
  1387.         format(title, sizeof(title), "   %s", GetName(id));
  1388.         ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, title, "Set health\nSet armour\nSet score\nGive money", "Ok", "Exit");
  1389.     }
  1390.     else if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 3)
  1391.     {
  1392.         if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /editinfo [ID]");
  1393.         else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1394.         SetPVarInt(playerid, "SelectedID", id);
  1395.         format(title, sizeof(title), "   %s", GetName(id));
  1396.         ShowPlayerDialog(playerid, 11, DIALOG_STYLE_LIST, title, "Set health\nSet armour\nSet money\nSet score\nSet kills\nSet deaths\nMake admin\nGive money", "Ok", "Exit");
  1397.     }
  1398.     return 1;
  1399. }
  1400.  
  1401. YCMD:respawn(playerid, params[], help)
  1402. {
  1403.     #pragma unused help
  1404.     #pragma unused params
  1405.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
  1406.     {
  1407.         RespawnVehicle();
  1408.         SendClientMessage(playerid, COLOR_YELLOW, "* Vehicles are respawned!");
  1409.     }
  1410.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1411.     return 1;
  1412. }
  1413.  
  1414. YCMD:gmx(playerid, params[], help)
  1415. {
  1416.     #pragma unused help
  1417.     #pragma unused params
  1418.     new reason;
  1419.     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
  1420.     {
  1421.         SendClientMessageToAll(COLOR_KRED, "* Server will restart in 5 seconds!");
  1422.         SetTimer("GMXTimer", 5000, 0);
  1423.         foreach(Player, i)
  1424.         {
  1425.             OnPlayerDisconnect(i, reason);
  1426.         }
  1427.     }
  1428.     else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
  1429.     return 1;
  1430. }
  1431.  
  1432.  
  1433. /*=================================================Stocks=================================================*/
  1434.  
  1435. stock GetName(playerid)
  1436. {
  1437.     new pName[MAX_PLAYER_NAME];
  1438.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1439.     return pName;
  1440. }
  1441.  
  1442. stock mysql_get_name(playerid)
  1443. {
  1444.     new mysqlname[MAX_PLAYER_NAME];
  1445.     mysql_real_escape_string(GetName(playerid), mysqlname);
  1446.     return mysqlname;
  1447. }
  1448.  
  1449. stock GetIP(playerid)
  1450. {
  1451.     new PIP[16];
  1452.     GetPlayerIp(playerid, PIP, sizeof(PIP));
  1453.     return PIP;
  1454. }
  1455.  
  1456. stock GetWeapon(weaponid)
  1457. {
  1458.     new gunname[32];
  1459.     GetWeaponName(weaponid, gunname, sizeof(gunname));
  1460.     return gunname;
  1461. }
  1462.  
  1463. stock SendClientMessageToAdmins(color, const string1[])
  1464. {
  1465.     foreach(Player, i)
  1466.     if(IsPlayerAdmin(i) || PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, color, string1);
  1467.     return 1;
  1468. }
  1469.  
  1470. stock RespawnVehicle()
  1471. {
  1472.     new bool: used[MAX_VEHICLES] = { false, ... };
  1473.     foreach(Player, i)
  1474.     {
  1475.         if(IsPlayerInAnyVehicle(i))
  1476.         {
  1477.             used[GetPlayerVehicleID(i)] = true;
  1478.         }
  1479.     }
  1480.     for(new v; v < MAX_VEHICLES; v++)
  1481.     {
  1482.         if(!used[v]) SetVehicleToRespawn(v);
  1483.     }
  1484. }
  1485.  
  1486. stock CreateVehicleForPlayer(playerid, vehiclename[], color1, color2)
  1487. {
  1488.     new VMID, CVID;
  1489.     if(strfind("Landstalker", vehiclename,true,0) != -1) VMID = 400;
  1490.     if(strfind("Bravura", vehiclename,true,0) != -1) VMID = 401;
  1491.     if(strfind("Buffalo", vehiclename,true,0) != -1) VMID = 402;
  1492.     if(strfind("Linerunner", vehiclename,true,0) != -1) VMID = 403;
  1493.     if(strfind("Perenniel", vehiclename,true,0) != -1) VMID = 404;
  1494.     if(strfind("Sentinel", vehiclename,true,0) != -1) VMID = 405;
  1495.     if(strfind("Dumper", vehiclename,true,0) != -1) VMID = 406;
  1496.     if(strfind("Firetuck", vehiclename,true,0) != -1) VMID = 407;
  1497.     if(strfind("Trashmaster", vehiclename,true,0) != -1) VMID = 408;
  1498.     if(strfind("Stretch", vehiclename,true,0) != -1) VMID = 409;
  1499.     if(strfind("Manana", vehiclename,true,0) != -1) VMID = 410;
  1500.     if(strfind("Infernus", vehiclename,true,0) != -1) VMID = 411;
  1501.     if(strfind("Voodoo", vehiclename,true,0) != -1) VMID = 412;
  1502.     if(strfind("Pony", vehiclename,true,0) != -1) VMID = 413;
  1503.     if(strfind("Mule", vehiclename,true,0) != -1) VMID = 414;
  1504.     if(strfind("Cheetah", vehiclename,true,0) != -1) VMID = 415;
  1505.     if(strfind("Ambulance", vehiclename,true,0) != -1) VMID = 416;
  1506.     if(strfind("Leviathan", vehiclename,true,0) != -1) VMID = 417;
  1507.     if(strfind("Moonbeam", vehiclename,true,0) != -1) VMID = 418;
  1508.     if(strfind("Esperanto", vehiclename,true,0) != -1) VMID = 419;
  1509.     if(strfind("Taxi", vehiclename,true,0) != -1) VMID = 420;
  1510.     if(strfind("Washington", vehiclename,true,0) != -1) VMID = 421;
  1511.     if(strfind("Bobcat", vehiclename,true,0) != -1) VMID = 422;
  1512.     if(strfind("Mr Whoopie", vehiclename,true,0) != -1) VMID = 423;
  1513.     if(strfind("BF Injection", vehiclename,true,0) != -1) VMID = 424;
  1514.     if(strfind("Hunter", vehiclename,true,0) != -1) VMID = 425;
  1515.     if(strfind("Premier", vehiclename,true,0) != -1) VMID = 426;
  1516.     if(strfind("Enforcer", vehiclename,true,0) != -1) VMID = 427;
  1517.     if(strfind("Securicar", vehiclename,true,0) != -1) VMID = 428;
  1518.     if(strfind("Banshee", vehiclename,true,0) != -1) VMID = 429;
  1519.     if(strfind("Predator", vehiclename,true,0) != -1) VMID = 430;
  1520.     if(strfind("Bus", vehiclename,true,0) != -1) VMID = 431;
  1521.     if(strfind("Rhino", vehiclename,true,0) != -1) VMID = 432;
  1522.     if(strfind("Barracks", vehiclename,true,0) != -1) VMID = 433;
  1523.     if(strfind("Hotknife", vehiclename,true,0) != -1) VMID = 434;
  1524.     if(strfind("ArticleTrailer", vehiclename,true,0) != -1) VMID = 435;
  1525.     if(strfind("Previon", vehiclename,true,0) != -1) VMID = 436;
  1526.     if(strfind("Coach", vehiclename,true,0) != -1) VMID = 437;
  1527.     if(strfind("Cabbie", vehiclename,true,0) != -1) VMID = 438;
  1528.     if(strfind("Stallion", vehiclename,true,0) != -1) VMID = 439;
  1529.     if(strfind("Rumpo", vehiclename,true,0) != -1) VMID = 440;
  1530.     if(strfind("RCBandit", vehiclename,true,0) != -1) VMID = 441;
  1531.     if(strfind("Romero", vehiclename,true,0) != -1) VMID = 442;
  1532.     if(strfind("Packer", vehiclename,true,0) != -1) VMID = 443;
  1533.     if(strfind("Monster", vehiclename,true,0) != -1) VMID = 444;
  1534.     if(strfind("Admiral", vehiclename,true,0) != -1) VMID = 445;
  1535.     if(strfind("Squallo", vehiclename,true,0) != -1) VMID = 446;
  1536.     if(strfind("Seasparrow", vehiclename,true,0) != -1) VMID = 447;
  1537.     if(strfind("Pizzaboy", vehiclename,true,0) != -1) VMID = 448;
  1538.     if(strfind("Tram", vehiclename,true,0) != -1) VMID = 449;
  1539.     if(strfind("Article Trailer 2", vehiclename,true,0) != -1) VMID = 450;
  1540.     if(strfind("Turismo", vehiclename,true,0) != -1) VMID = 451;
  1541.     if(strfind("Speeder", vehiclename,true,0) != -1) VMID = 452;
  1542.     if(strfind("Reefer", vehiclename,true,0) != -1) VMID = 453;
  1543.     if(strfind("Tropic", vehiclename,true,0) != -1) VMID = 454;
  1544.     if(strfind("Flatbed", vehiclename,true,0) != -1) VMID = 455;
  1545.     if(strfind("Yankee", vehiclename,true,0) != -1) VMID = 456;
  1546.     if(strfind("Caddy", vehiclename,true,0) != -1) VMID = 457;
  1547.     if(strfind("Solair", vehiclename,true,0) != -1) VMID = 458;
  1548.     if(strfind("Berkley's RC Van", vehiclename,true,0) != -1) VMID = 459;
  1549.     if(strfind("Skimmer", vehiclename,true,0) != -1) VMID = 460;
  1550.     if(strfind("PCJ600", vehiclename,true,0) != -1) VMID = 461;
  1551.     if(strfind("Faggio", vehiclename,true,0) != -1) VMID = 462;
  1552.     if(strfind("Freeway", vehiclename,true,0) != -1) VMID = 463;
  1553.     if(strfind("RCBaron", vehiclename,true,0) != -1) VMID = 464;
  1554.     if(strfind("RCRaider", vehiclename,true,0) != -1) VMID = 465;
  1555.     if(strfind("Glendale", vehiclename,true,0) != -1) VMID = 466;
  1556.     if(strfind("Oceanic", vehiclename,true,0) != -1) VMID = 467;
  1557.     if(strfind("Sanchez", vehiclename,true,0) != -1) VMID = 468;
  1558.     if(strfind("Sparrow", vehiclename,true,0) != -1) VMID = 469;
  1559.     if(strfind("Patriot", vehiclename,true,0) != -1) VMID = 470;
  1560.     if(strfind("Quad", vehiclename,true,0) != -1) VMID = 471;
  1561.     if(strfind("Coastguard", vehiclename,true,0) != -1) VMID = 472;
  1562.     if(strfind("Dinghy", vehiclename,true,0) != -1) VMID = 473;
  1563.     if(strfind("Hermes", vehiclename,true,0) != -1) VMID = 474;
  1564.     if(strfind("Sabre", vehiclename,true,0) != -1) VMID = 475;
  1565.     if(strfind("Rustler", vehiclename,true,0) != -1) VMID = 476;
  1566.     if(strfind("ZR350", vehiclename,true,0) != -1) VMID = 477;
  1567.     if(strfind("Walton", vehiclename,true,0) != -1) VMID = 478;
  1568.     if(strfind("Regina", vehiclename,true,0) != -1) VMID = 479;
  1569.     if(strfind("Comet", vehiclename,true,0) != -1) VMID = 480;
  1570.     if(strfind("BMX", vehiclename,true,0) != -1) VMID = 481;
  1571.     if(strfind("Burrito", vehiclename,true,0) != -1) VMID = 482;
  1572.     if(strfind("Camper", vehiclename,true,0) != -1) VMID = 483;
  1573.     if(strfind("Marquis", vehiclename,true,0) != -1) VMID = 484;
  1574.     if(strfind("Baggage", vehiclename,true,0) != -1) VMID = 485;
  1575.     if(strfind("Dozer", vehiclename,true,0) != -1) VMID = 486;
  1576.     if(strfind("Maverick", vehiclename,true,0) != -1) VMID = 487;
  1577.     if(strfind("SAN News Maverick", vehiclename,true,0) != -1) VMID = 488;
  1578.     if(strfind("Rancher", vehiclename,true,0) != -1) VMID = 489;
  1579.     if(strfind("FBI Rancher", vehiclename,true,0) != -1) VMID = 490;
  1580.     if(strfind("Virgo", vehiclename,true,0) != -1) VMID = 491;
  1581.     if(strfind("Greenwood", vehiclename,true,0) != -1) VMID = 492;
  1582.     if(strfind("Jetmax", vehiclename,true,0) != -1) VMID = 493;
  1583.     if(strfind("Hotring Racer", vehiclename,true,0) != -1) VMID = 494;
  1584.     if(strfind("Sandking", vehiclename,true,0) != -1) VMID = 495;
  1585.     if(strfind("Blista Compact", vehiclename,true,0) != -1) VMID = 496;
  1586.     if(strfind("Police Maverick", vehiclename,true,0) != -1) VMID = 497;
  1587.     if(strfind("Boxville", vehiclename,true,0) != -1) VMID = 498;
  1588.     if(strfind("Benson", vehiclename,true,0) != -1) VMID = 499;
  1589.     if(strfind("Mesa", vehiclename,true,0) != -1) VMID = 500;
  1590.     if(strfind("RC Goblin", vehiclename,true,0) != -1) VMID = 501;
  1591.     if(strfind("Hotring Racer", vehiclename,true,0) != -1) VMID = 502;
  1592.     if(strfind("Hotring Racer", vehiclename,true,0) != -1) VMID = 503;
  1593.     if(strfind("Bloodring Banger", vehiclename,true,0) != -1) VMID = 505;
  1594.     if(strfind("Rancher", vehiclename,true,0) != -1) VMID = 505;
  1595.     if(strfind("Super GT", vehiclename,true,0) != -1) VMID = 506;
  1596.     if(strfind("Elegant", vehiclename,true,0) != -1) VMID = 507;
  1597.     if(strfind("Journey", vehiclename,true,0) != -1) VMID = 508;
  1598.     if(strfind("Bike", vehiclename,true,0) != -1) VMID = 509;
  1599.     if(strfind("Mountain Bike", vehiclename,true,0) != -1) VMID = 510;
  1600.     if(strfind("Beagle", vehiclename,true,0) != -1) VMID = 511;
  1601.     if(strfind("Cropduster", vehiclename,true,0) != -1) VMID = 512;
  1602.     if(strfind("Stuntplane", vehiclename,true,0) != -1) VMID = 513;
  1603.     if(strfind("Tanker", vehiclename,true,0) != -1) VMID = 515;
  1604.     if(strfind("Roadtrain", vehiclename,true,0) != -1) VMID = 515;
  1605.     if(strfind("Nebula", vehiclename,true,0) != -1) VMID = 516;
  1606.     if(strfind("Majestic", vehiclename,true,0) != -1) VMID = 517;
  1607.     if(strfind("Buccaneer", vehiclename,true,0) != -1) VMID = 518;
  1608.     if(strfind("Shamal", vehiclename,true,0) != -1) VMID = 519;
  1609.     if(strfind("Hydra", vehiclename,true,0) != -1) VMID = 520;
  1610.     if(strfind("FCR-900", vehiclename,true,0) != -1) VMID = 521;
  1611.     if(strfind("NRG-500", vehiclename,true,0) != -1) VMID = 522;
  1612.     if(strfind("HPV1000", vehiclename,true,0) != -1) VMID = 523;
  1613.     if(strfind("Cement Truck", vehiclename,true,0) != -1) VMID = 525;
  1614.     if(strfind("Towtruck", vehiclename,true,0) != -1) VMID = 525;
  1615.     if(strfind("Fortune", vehiclename,true,0) != -1) VMID = 526;
  1616.     if(strfind("Cadrona", vehiclename,true,0) != -1) VMID = 527;
  1617.     if(strfind("FBI Truck", vehiclename,true,0) != -1) VMID = 528;
  1618.     if(strfind("Willard", vehiclename,true,0) != -1) VMID = 529;
  1619.     if(strfind("Forklift", vehiclename,true,0) != -1) VMID = 530;
  1620.     if(strfind("Tractor", vehiclename,true,0) != -1) VMID = 531;
  1621.     if(strfind("Combine Harvester", vehiclename,true,0) != -1) VMID = 532;
  1622.     if(strfind("Feltzer", vehiclename,true,0) != -1) VMID = 533;
  1623.     if(strfind("Remington", vehiclename,true,0) != -1) VMID = 535;
  1624.     if(strfind("Slamvan", vehiclename,true,0) != -1) VMID = 535;
  1625.     if(strfind("Blade", vehiclename,true,0) != -1) VMID = 536;
  1626.     if(strfind("Freight Train", vehiclename,true,0) != -1) VMID = 537;
  1627.     if(strfind("Brownstreak Train", vehiclename,true,0) != -1) VMID = 538;
  1628.     if(strfind("Vortex", vehiclename,true,0) != -1) VMID = 539;
  1629.     if(strfind("Vincent", vehiclename,true,0) != -1) VMID = 540;
  1630.     if(strfind("Bullet", vehiclename,true,0) != -1) VMID = 541;
  1631.     if(strfind("Clover", vehiclename,true,0) != -1) VMID = 542;
  1632.     if(strfind("Sadler", vehiclename,true,0) != -1) VMID = 543;
  1633.     if(strfind("Firetruck LA", vehiclename,true,0) != -1) VMID = 544;
  1634.     if(strfind("Hustler", vehiclename,true,0) != -1) VMID = 545;
  1635.     if(strfind("Intruder", vehiclename,true,0) != -1) VMID = 546;
  1636.     if(strfind("Primo", vehiclename,true,0) != -1) VMID = 547;
  1637.     if(strfind("Cargobob", vehiclename,true,0) != -1) VMID = 548;
  1638.     if(strfind("Tampa", vehiclename,true,0) != -1) VMID = 549;
  1639.     if(strfind("Sunrise", vehiclename,true,0) != -1) VMID = 550;
  1640.     if(strfind("Merit", vehiclename,true,0) != -1) VMID = 551;
  1641.     if(strfind("Utility Van", vehiclename,true,0) != -1) VMID = 552;
  1642.     if(strfind("Nevada", vehiclename,true,0) != -1) VMID = 553;
  1643.     if(strfind("Yosemite", vehiclename,true,0) != -1) VMID = 555;
  1644.     if(strfind("Windsor", vehiclename,true,0) != -1) VMID = 555;
  1645.     if(strfind("MonsterA", vehiclename,true,0) != -1) VMID = 556;
  1646.     if(strfind("MonsterB", vehiclename,true,0) != -1) VMID = 557;
  1647.     if(strfind("Uranus", vehiclename,true,0) != -1) VMID = 558;
  1648.     if(strfind("Jester", vehiclename,true,0) != -1) VMID = 559;
  1649.     if(strfind("Sultan", vehiclename,true,0) != -1) VMID = 560;
  1650.     if(strfind("Stratum", vehiclename,true,0) != -1) VMID = 561;
  1651.     if(strfind("Elegy", vehiclename,true,0) != -1) VMID = 562;
  1652.     if(strfind("Raindance", vehiclename,true,0) != -1) VMID = 563;
  1653.     if(strfind("RC Tiger", vehiclename,true,0) != -1) VMID = 564;
  1654.     if(strfind("Flash", vehiclename,true,0) != -1) VMID = 565;
  1655.     if(strfind("Tahoma", vehiclename,true,0) != -1) VMID = 566;
  1656.     if(strfind("Savanna", vehiclename,true,0) != -1) VMID = 567;
  1657.     if(strfind("Bandito", vehiclename,true,0) != -1) VMID = 568;
  1658.     if(strfind("Freight Flat Trailer", vehiclename,true,0) != -1) VMID = 569;
  1659.     if(strfind("Streak Trailer", vehiclename,true,0) != -1) VMID = 570;
  1660.     if(strfind("Kart", vehiclename,true,0) != -1) VMID = 571;
  1661.     if(strfind("Mower", vehiclename,true,0) != -1) VMID = 572;
  1662.     if(strfind("Dune", vehiclename,true,0) != -1) VMID = 573;
  1663.     if(strfind("Sweeper", vehiclename,true,0) != -1) VMID = 574;
  1664.     if(strfind("Broadway", vehiclename,true,0) != -1) VMID = 575;
  1665.     if(strfind("Tornado", vehiclename,true,0) != -1) VMID = 576;
  1666.     if(strfind("AT400", vehiclename,true,0) != -1) VMID = 577;
  1667.     if(strfind("DFT30", vehiclename,true,0) != -1) VMID = 578;
  1668.     if(strfind("Huntley", vehiclename,true,0) != -1) VMID = 579;
  1669.     if(strfind("Stafford", vehiclename,true,0) != -1) VMID = 580;
  1670.     if(strfind("BF400", vehiclename,true,0) != -1) VMID = 581;
  1671.     if(strfind("Newsvan", vehiclename,true,0) != -1) VMID = 582;
  1672.     if(strfind("Tug", vehiclename,true,0) != -1) VMID = 583;
  1673.     if(strfind("Petrol Trailer", vehiclename,true,0) != -1) VMID = 584;
  1674.     if(strfind("Emperor", vehiclename,true,0) != -1) VMID = 585;
  1675.     if(strfind("Wayfarer", vehiclename,true,0) != -1) VMID = 586;
  1676.     if(strfind("Euros", vehiclename,true,0) != -1) VMID = 587;
  1677.     if(strfind("Hotdog", vehiclename,true,0) != -1) VMID = 588;
  1678.     if(strfind("Club", vehiclename,true,0) != -1) VMID = 589;
  1679.     if(strfind("Freight Box Trailer", vehiclename,true,0) != -1) VMID = 590;
  1680.     if(strfind("Article Trailer 3", vehiclename,true,0) != -1) VMID = 591;
  1681.     if(strfind("Andromada", vehiclename,true,0) != -1) VMID = 592;
  1682.     if(strfind("Dodo", vehiclename,true,0) != -1) VMID = 593;
  1683.     if(strfind("RCCam", vehiclename,true,0) != -1) VMID = 595;
  1684.     if(strfind("Launch", vehiclename,true,0) != -1) VMID = 595;
  1685.     if(strfind("Police Car LSPD", vehiclename,true,0) != -1) VMID = 596;
  1686.     if(strfind("Police Car SFPP", vehiclename,true,0) != -1) VMID = 597;
  1687.     if(strfind("Police Car LVPD", vehiclename,true,0) != -1) VMID = 598;
  1688.     if(strfind("Police Ranger", vehiclename,true,0) != -1) VMID = 599;
  1689.     if(strfind("S.W.A.T. SWAT", vehiclename,true,0) != -1) VMID = 601;
  1690.     if(strfind("Alpha", vehiclename,true,0) != -1) VMID = 602;
  1691.     if(strfind("Phoenix", vehiclename,true,0) != -1) VMID = 603;
  1692.     if(strfind("Glendale Shit", vehiclename,true,0) != -1) VMID = 604;
  1693.     if(strfind("Sadler Shit", vehiclename,true,0) != -1) VMID = 605;
  1694.     if(strfind("Baggage Trailer A", vehiclename,true,0) != -1) VMID = 606;
  1695.     if(strfind("Baggage Trailer B", vehiclename,true,0) != -1) VMID = 607;
  1696.     if(strfind("Tug Stairs Trailer", vehiclename,true,0) != -1) VMID = 608;
  1697.     if(strfind("Boxville", vehiclename,true,0) != -1) VMID = 609;
  1698.     if(strfind("Farm Trailer", vehiclename,true,0) != -1) VMID = 610;
  1699.     if(strfind("Utility Trailer", vehiclename,true,0) != -1) VMID = 611;
  1700.  
  1701.     if(strlen(vehiclename) == 3 && strval(vehiclename) >= 400 && strval(vehiclename) <= 611) VMID = strval(vehiclename);
  1702.     if(VMID == 0) return SendClientMessage(playerid, COLOR_WHITE, "* Netočno ime vozila!");
  1703.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1704.     GetPlayerFacingAngle(playerid, Pos[3]);
  1705.     if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  1706.     CVID = CreateVehicle(VMID, Pos[0], Pos[1], Pos[2] + 0.6, Pos[3], color1, color2, 0);
  1707.     SetVehicleVirtualWorld(CVID, GetPlayerVirtualWorld(playerid));
  1708.     LinkVehicleToInterior(CVID, GetPlayerInterior(playerid));
  1709.     PutPlayerInVehicle(playerid, CVID, 0);
  1710.     SetPVarInt(playerid, "Vehicle", VMID);
  1711.     SetPVarInt(playerid, "VehicleCreated", CVID);
  1712.     return 1;
  1713. }
  1714.  
  1715. stock SetPlayerPosWithVehicle(playerid, Float: X, Float: Y, Float: Z)
  1716. {
  1717.     SetPlayerPos(playerid, X, Y, Z);
  1718.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1719.     {
  1720.         LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(playerid));
  1721.         SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
  1722.         PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
  1723.     }
  1724. }
  1725.  
  1726. stock CustomBan(id, playerid, reason[])
  1727. {
  1728.     format(Query, sizeof(Query), "INSERT INTO `bans` (Banned, Administrator, Reason) VALUES ('%s', '%s', '%s')", mysql_get_name(id), mysql_get_name(playerid), reason);
  1729.     mysql_query(Query);
  1730.     Kick(id);
  1731.     return 1;
  1732. }
  1733.  
  1734. stock CustomUnban(name[])
  1735. {
  1736.     if(strlen(name) > MAX_PLAYER_NAME) return 0;
  1737.     mysql_real_escape_string(name, name);
  1738.     format(Query, sizeof(Query), "DELETE FROM `bans` WHERE Banned = '%s'", name);
  1739.     mysql_query(Query);
  1740.     return 1;
  1741. }
  1742.  
  1743. stock CustomBanCheck(playerid)
  1744. {
  1745.     new name[MAX_PLAYER_NAME], administrator[MAX_PLAYER_NAME], reason[128], day[11], month[11], year[11], bstring[256];
  1746.     format(Query, sizeof(Query), "SELECT * FROM `bans` WHERE `Banned` = '%s' LIMIT 1", mysql_get_name(playerid));
  1747.     mysql_query(Query);
  1748.     mysql_store_result();
  1749.     if(mysql_num_rows() != 0)
  1750.     {
  1751.         while(mysql_fetch_row_format(Query, "|"))
  1752.         {
  1753.             mysql_fetch_field_row(name, "Banned");
  1754.             mysql_fetch_field_row(administrator, "Administrator");
  1755.             mysql_fetch_field_row(reason, "Reason");
  1756.             mysql_fetch_field_row(day, "Day");
  1757.             mysql_fetch_field_row(month, "Month");
  1758.             mysql_fetch_field_row(year, "Year");
  1759.         }
  1760.         format(bstring, sizeof(bstring), "{F81414}Name: {FFFFFF}%s\n{F81414}Administrator: {FFFFFF}%s\n{F81414}Reason: {FFFFFF}%s\n{F81414}Date: {FFFFFF}%02d.%02d.%d.", name, administrator, reason, day, month, year);
  1761.         ShowPlayerDialog(playerid, 87, DIALOG_STYLE_MSGBOX, "     {FFFFFF}Protjerani ste s ovog servera!", bstring, "Ok", "");
  1762.         ClearChatForPlayer(playerid);
  1763.         Kick(playerid);
  1764.     }
  1765.     mysql_free_result();
  1766.     return 1;
  1767. }
  1768.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement