Advertisement
maxtorcd55

Untitled

Apr 24th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 57.76 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4. #define KEY_AIM 128
  5.  
  6.  
  7. #include <a_samp>
  8. #include <Dini>
  9.  
  10. new AdminDialog[] = {201,202,203,204,205};
  11. new SpeedBoostDialog[] = {221,222,223,224,225};
  12. new RegisterDialog[] = {241,242,243,244,245};
  13. new WeaponDialog[] = {261,262,263,264,265,266,267,268,269,270,271,272};
  14. new GravityDialog[] = {281,282};
  15. new AudioDialog[] = {291,292};
  16. new BankDialog[] = {301,302,303,304,305,306,307,308,309};
  17. new LotoDialog[] = {311,312,313};
  18. new CMDDialog[] = {321,322,323};
  19. new clickply[MAX_PLAYERS];
  20. new freezply[MAX_PLAYERS];
  21. new PlayerAdmin[MAX_PLAYERS];
  22. new Float:SpeedBoostMultiplier[2][MAX_PLAYERS];
  23. new PlyLogin[MAX_PLAYERS];
  24. new AutoSaveTime = 1;
  25. new IsplayerSpawned[MAX_PLAYERS];
  26. new WeaponDiaString[MAX_PLAYERS][250];
  27. new Text:BankShow0[MAX_PLAYERS];
  28. new MoneyransferID[MAX_PLAYERS];
  29.  
  30.  
  31.  
  32.  
  33. new PlayerColors[200] = {
  34. 0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,
  35. 0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,
  36. 0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
  37. 0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
  38. 0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
  39. 0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
  40. 0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
  41. 0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
  42. 0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
  43. 0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
  44. 0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
  45. 0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
  46. 0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
  47. 0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
  48. 0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
  49. 0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
  50. 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
  51. 0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
  52. 0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
  53. 0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
  54. 0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
  55. 0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
  56. 0xD8C762FF,0xD8C762FF
  57. };
  58.  
  59.  
  60. new weapons[13][2][MAX_PLAYERS];
  61.  
  62. enum WeaponInfo
  63. {
  64.     Name[64],
  65.     Slot,
  66.     Ammo,
  67.     Prices
  68. }
  69.  
  70. new WeaponList[][WeaponInfo]=
  71. {
  72.  
  73.      {"Fist", 0, 1, 0},
  74.      {"Brass Knuckles", 0, 1, 40},
  75.      {"Golf Club", 1, 1, 200},
  76.      {"Nightstick", 1, 1, 20},
  77.      {"Knife", 1, 1, 50},
  78.      {"Baseball Bat", 1, 1, 25},
  79.      {"Shovel", 1, 1, 80},
  80.      {"Pool Cue", 1, 1, 30},
  81.      {"Katana", 1, 1, 25000},
  82.      {"Chainsaw", 1, 1, 25000},
  83.      {"Double-ended Dildo", 10, 1, 75},
  84.      {"Dildo", 10, 1, 50},
  85.      {"Vibrator", 10, 1, 35},
  86.      {"Silver Vibrator", 10, 1, 65},
  87.      {"FLowers", 10, 1, 50},
  88.      {"Cane", 10, 1, 150},
  89.      {"Grenade", 8, 5, 300},
  90.      {"Tear Gas", 8, 10, 120},
  91.      {"Molotov Cocktail", 8, 2, 50},
  92.      {"empty", 0, 0, 0},
  93.      {"empty", 0, 0, 0},
  94.      {"empty", 0, 0, 0},
  95.      {"9mm", 2, 30, 200},
  96.      {"Silenced 9mm", 2, 30, 600},
  97.      {"Desert Eagle", 2, 20, 1500},
  98.      {"Shotgun", 3, 45, 1200},
  99.      {"Sawnoff Shotgun", 3, 12, 800},
  100.      {"Combat Shotgun", 3, 10, 1000},
  101.      {"Micro SMG/Uzi", 4, 90, 2000},
  102.      {"MP5", 4, 90, 2000},
  103.      {"AK-47", 5, 120, 3500},
  104.      {"M4", 5, 150, 3500},
  105.      {"Tec-9", 4, 150, 5000},
  106.      {"Country Rifle", 6, 25, 1000},
  107.      {"Sniper Rifle", 6, 15, 5000},
  108.      {"RPG", 7, 1, 4000},
  109.      {"HS Rocket", 7, 1, 2500},
  110.      {"Flamethrower", 7, 50, 250},
  111.      {"Minigun", 7, 120, 10000},
  112.      {"Satchel Charge", 8, 2, 2000},
  113.      {"Detonator_NotInUse", 12, 1, 0},
  114.      {"Spraycan", 9, 100, 15},
  115.      {"Fire Extinguisher", 9, 65, 5},
  116.      {"Camera", 9, 10, 0},
  117.      {"Night Vis Goggles_NotInUse", 11, 1, 0},
  118.      {"Thermal Goggles_NotInUse", 11, 1, 0},
  119.      {"Parachute", 11, 1, 10}
  120.  
  121. };
  122.  
  123. new Float:ux,Float:uy,Float:dx,Float:dy;
  124.  
  125.  
  126.  
  127.  
  128. new uurs,mins;
  129.  
  130. new Gangz;
  131.  
  132.  
  133.  
  134. #if defined FILTERSCRIPT
  135.  
  136. public OnFilterScriptInit()
  137. {
  138.     print("\n--------------------------------------");
  139.     print("-------------eXa-Admin------------------");
  140.     print("--------------------------------------\n");
  141.    
  142.     return 1;
  143. }
  144.  
  145. public OnFilterScriptExit()
  146. {
  147.     return 1;
  148. }
  149.  
  150. #else
  151.  
  152. main()
  153. {
  154.     print("\n----------------------------------");
  155.     print("-------------eXa-Admin---------------");
  156.     print("----------------------------------\n");
  157.    
  158. }
  159.  
  160. #endif
  161.  
  162. public OnGameModeInit()
  163. {
  164.     SetTimer("MainTimer", 1000, true);
  165.     SetTimer("AutoSave", AutoSaveTime*60*1000, true);
  166.  
  167.     return 1;
  168. }
  169.  
  170. forward MainTimer();
  171. public MainTimer()
  172. {
  173.  
  174.  
  175.  
  176.     for(new i; i<MAX_PLAYERS; i++)
  177.     {
  178.         if(IsPlayerConnected(i))
  179.         {
  180.             SetPlayerTime(i,uurs,mins);
  181.  
  182.         }
  183.     }
  184.  
  185.     mins++;
  186.     if(mins > 59)
  187.     {
  188.         uurs++;
  189.         mins=0;
  190.     }
  191.     if(uurs > 23)
  192.     {
  193.         uurs=0;
  194.  
  195.     }
  196.  
  197.     for(new i; i<MAX_PLAYERS; i++)
  198.     {
  199.         if(IsPlayerConnected(i))
  200.         {
  201.             if(PlyLogin[i] == 1 && IsplayerSpawned[i] == 1)
  202.             {
  203.                 new file[128], pname[MAX_PLAYER_NAME];
  204.                 GetPlayerName(i, pname, sizeof(pname));
  205.                 format(file, sizeof(file), "\\Users\\%s.ini", pname);
  206.                 new MoneyString[128];
  207.                 format(MoneyString, sizeof(MoneyString), "~b~$%08d",floatround(dini_Float(file, "Bank"), floatround_round));
  208.                 TextDrawSetString(BankShow0[i], MoneyString);
  209.                 TextDrawShowForPlayer(i, BankShow0[i]);
  210.                
  211.  
  212.  
  213.             }
  214.         }
  215.     }
  216.     return 1;
  217. }
  218.  
  219.  
  220. forward AutoSave();
  221. public AutoSave()
  222. {
  223.     for(new i; i<MAX_PLAYERS; i++)
  224.     {
  225.         if(IsPlayerConnected(i))
  226.         {
  227.             if(PlyLogin[i] == 1 && IsplayerSpawned[i] == 1)
  228.             {
  229.        
  230.                 new file[128], pname[MAX_PLAYER_NAME];
  231.                 GetPlayerName(i, pname, sizeof(pname));
  232.                 format(file, sizeof(file), "\\Users\\%s.ini", pname);
  233.                 dini_IntSet(file, "Score", GetPlayerScore(i));
  234.                 dini_IntSet(file, "Money", GetPlayerMoney(i));
  235.                 dini_IntSet(file, "PlayTime", dini_Int(file, "PlayTime" )+AutoSaveTime);
  236.                 dini_FloatSet(file, "SSB",SpeedBoostMultiplier[0][i]);
  237.                 dini_FloatSet(file, "SSB1",SpeedBoostMultiplier[1][i]);
  238.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")*1.0001);
  239.  
  240.                 for (new wep = 0; wep < 13; wep++)
  241.                 {
  242.                     new WeaponDini[24],WeaponDiniAmmo[24];
  243.                     GetPlayerWeaponData(i, wep, weapons[i][0][wep], weapons[i][1][wep]);
  244.                     format(WeaponDini, sizeof(WeaponDini), "Slot%dWep", wep);
  245.                     dini_IntSet(file, WeaponDini, weapons[i][0][wep]);
  246.  
  247.                     format(WeaponDiniAmmo, sizeof(WeaponDiniAmmo), "Slot%dAmmo", wep);
  248.                     dini_IntSet(file, WeaponDiniAmmo, weapons[i][1][wep]);
  249.                 }
  250.  
  251.                
  252.  
  253.             }
  254.         }
  255.     }
  256.  
  257.     return 1;
  258. }
  259.  
  260. public OnGameModeExit()
  261. {
  262.     return 1;
  263. }
  264.  
  265. public OnPlayerRequestClass(playerid, classid)
  266. {
  267.  
  268.     return 1;
  269. }
  270.  
  271. public OnPlayerConnect(playerid)
  272. {
  273.    
  274.     BankShow0[playerid] = TextDrawCreate(499.0,100.0, " ");
  275.     //TextDrawTextSize(BankShow0[playerid], 620.0, 480.0);
  276.     TextDrawLetterSize(BankShow0[playerid],0.61,2.15);
  277.     TextDrawFont(BankShow0[playerid], 3);
  278.     TextDrawSetShadow(BankShow0[playerid],2);
  279.     TextDrawSetProportional(BankShow0[playerid],1);
  280.     TextDrawColor(BankShow0[playerid],0x000000FF);
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.     PlayerAdmin[playerid]=0;
  288.     PlyLogin[playerid] = 0;
  289.     SpeedBoostMultiplier[0][playerid]=1.2;
  290.     SpeedBoostMultiplier[1][playerid]=1.2;
  291.     SetPlayerColor(playerid, PlayerColors[playerid]);
  292.     TogglePlayerClock(playerid, 1);
  293.     IsplayerSpawned[playerid] = 0;
  294.    
  295.  
  296.     for (new wep = 0; wep < 13; wep++)
  297.     {
  298.         weapons[wep][0][playerid]=0;
  299.         weapons[wep][1][playerid]=0;
  300.  
  301.  
  302.     }
  303.  
  304.    
  305.     new plrIP[16];
  306.     GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  307.  
  308.  
  309.  
  310.     new file[128], pname[MAX_PLAYER_NAME];
  311.     GetPlayerName(playerid, pname, sizeof(pname));
  312.     format(file, sizeof(file), "\\Users\\%s.ini", pname);
  313.    
  314.     if(!dini_Exists(file))
  315.     {
  316.  
  317.         dini_Create(file);
  318.         dini_Set(file, "Pass", "none");
  319.         dini_IntSet(file, "Admin", 0);
  320.         dini_IntSet(file, "Score", 0);
  321.         dini_IntSet(file, "Money", 0);
  322.         dini_IntSet(file, "Bank", 0);
  323.         dini_IntSet(file, "Register", 0);
  324.         dini_FloatSet(file, "SSB", 1.2);
  325.         dini_Set(file, "Ip", plrIP);
  326.         PlyLogin[playerid] = 1;
  327.     }
  328.     else
  329.     {
  330.         if(!strcmp(plrIP, dini_Get(file, "Ip")))
  331.         {
  332.  
  333.             IsPLYLoggedIn(playerid);
  334.  
  335.             if(dini_Int(file, "Register") == 1)
  336.             {
  337.                 SendClientMessage(playerid, 0x00FF00FF, "You are automatic logged in!");
  338.             }
  339.  
  340.  
  341.  
  342.  
  343.    
  344.         }
  345.  
  346.         else if(dini_Int(file, "Register") == 1)
  347.         {
  348.             SendClientMessage(playerid, 0x00FFFFFF, "Use '/Login'");
  349.         }
  350.  
  351.     }
  352.    
  353.     if(dini_Int(file, "Register") == 0)
  354.     {
  355.         SendClientMessage(playerid, 0x00FFFFFF, "Use '/register'");
  356.     }
  357.  
  358.  
  359.  
  360.    
  361.    
  362.     return 1;
  363. }
  364.  
  365.  
  366. stock IsPLYLoggedIn(playerid)
  367. {
  368.  
  369.     new file[128], pname[MAX_PLAYER_NAME];
  370.     GetPlayerName(playerid, pname, sizeof(pname));
  371.     format(file, sizeof(file), "\\Users\\%s.ini", pname);
  372.     PlayerAdmin[playerid]=dini_Int(file, "Admin");
  373.     SetPlayerScore(playerid, dini_Int(file, "Score"));
  374.     ResetPlayerMoney(playerid);
  375.     GivePlayerMoney(playerid, dini_Int(file, "Money"));
  376.    
  377.     PlyLogin[playerid] = 1;
  378.  
  379.     SpeedBoostMultiplier[0][playerid]=dini_Float(file, "SSB");
  380.     SpeedBoostMultiplier[1][playerid]=dini_Float(file, "SSB1");
  381.    
  382.    
  383.     for (new wep = 0; wep < 13; wep++)
  384.     {
  385.         new WeaponDini[24],WeaponDiniAmmo[24];
  386.         format(WeaponDini, sizeof(WeaponDini), "Slot%dWep", wep);
  387.         format(WeaponDiniAmmo, sizeof(WeaponDiniAmmo), "Slot%dAmmo", wep);
  388.         GivePlayerWeapon(playerid, dini_Int(file, WeaponDini), dini_Int(file, WeaponDiniAmmo));
  389.     }
  390.    
  391.     return 1;
  392. }
  393.  
  394.  
  395.  
  396.  
  397.  
  398. public OnPlayerDisconnect(playerid, reason)
  399. {
  400.     if(PlyLogin[playerid] == 1)
  401.     {
  402.  
  403.         new file[128], pname[MAX_PLAYER_NAME];
  404.         GetPlayerName(playerid, pname, sizeof(pname));
  405.         format(file, sizeof(file), "\\Users\\%s.ini", pname);
  406.         dini_IntSet(file, "Score", GetPlayerScore(playerid));
  407.         dini_IntSet(file, "Money", GetPlayerMoney(playerid));
  408.         dini_FloatSet(file, "SSB",SpeedBoostMultiplier[0][playerid]);
  409.         dini_FloatSet(file, "SSB1",SpeedBoostMultiplier[1][playerid]);
  410.        
  411.         for (new wep = 0; wep < 13; wep++)
  412.         {
  413.             new WeaponDini[24],WeaponDiniAmmo[24];
  414.             GetPlayerWeaponData(playerid, wep, weapons[playerid][0][wep], weapons[playerid][1][wep]);
  415.             format(WeaponDini, sizeof(WeaponDini), "Slot%dWep", wep);
  416.             dini_IntSet(file, WeaponDini, weapons[playerid][0][wep]);
  417.  
  418.             format(WeaponDiniAmmo, sizeof(WeaponDiniAmmo), "Slot%dAmmo", wep);
  419.             dini_IntSet(file, WeaponDiniAmmo, weapons[playerid][1][wep]);
  420.         }
  421.        
  422.  
  423.     }
  424.    
  425.    
  426.    
  427.    
  428.    
  429.     return 1;
  430. }
  431.  
  432. public OnPlayerSpawn(playerid)
  433. {
  434.  
  435.     IsplayerSpawned[playerid] = 1;
  436.     if(PlyLogin[playerid] == 1)
  437.     {
  438.         new file[128], pname[MAX_PLAYER_NAME];
  439.         GetPlayerName(playerid, pname, sizeof(pname));
  440.         format(file, sizeof(file), "\\Users\\%s.ini", pname);
  441.         for (new wep = 0; wep < 13; wep++)
  442.         {
  443.             new WeaponDini[24],WeaponDiniAmmo[24];
  444.             format(WeaponDini, sizeof(WeaponDini), "Slot%dWep", wep);
  445.             format(WeaponDiniAmmo, sizeof(WeaponDiniAmmo), "Slot%dAmmo", wep);
  446.             GivePlayerWeapon(playerid, dini_Int(file, WeaponDini), dini_Int(file, WeaponDiniAmmo));
  447.         }
  448.        
  449.     }
  450.     return 1;
  451. }
  452.  
  453. public OnPlayerDeath(playerid, killerid, reason)
  454. {
  455.     for (new wep = 0; wep < 13; wep++)
  456.     {
  457.         new file[128], pname[MAX_PLAYER_NAME];
  458.         GetPlayerName(playerid, pname, sizeof(pname));
  459.         format(file, sizeof(file), "\\Users\\%s.ini", pname);
  460.         new WeaponDini[24],WeaponDiniAmmo[24];
  461.         GetPlayerWeaponData(playerid, wep, weapons[playerid][0][wep], weapons[playerid][1][wep]);
  462.         format(WeaponDini, sizeof(WeaponDini), "Slot%dWep", wep);
  463.         dini_IntSet(file, WeaponDini, weapons[playerid][0][wep]);
  464.  
  465.         format(WeaponDiniAmmo, sizeof(WeaponDiniAmmo), "Slot%dAmmo", wep);
  466.         dini_IntSet(file, WeaponDiniAmmo, weapons[playerid][1][wep]);
  467.     }
  468.  
  469.     return 1;
  470. }
  471.  
  472. public OnVehicleSpawn(vehicleid)
  473. {
  474.     return 1;
  475. }
  476.  
  477. public OnVehicleDeath(vehicleid, killerid)
  478. {
  479.     return 1;
  480. }
  481.  
  482. public OnPlayerText(playerid, text[])
  483. {
  484.     return 1;
  485. }
  486.  
  487. public OnPlayerCommandText(playerid, cmdtext[])
  488. {
  489.     if (strcmp("/ssb", cmdtext, true, 10) == 0)
  490.     {
  491.        
  492.         if(PlyLogin[playerid] == 1)
  493.         {
  494.             new ssbs[45];
  495.             format(ssbs,sizeof(ssbs),"SSB1 - Set: %.2f\nSSB2 - Set: %.2f",SpeedBoostMultiplier[0][playerid],SpeedBoostMultiplier[1][playerid]);
  496.             ShowPlayerDialog(playerid, SpeedBoostDialog[3], DIALOG_STYLE_LIST, "Select Speedboost", ssbs, "ok", "Cancel");
  497.  
  498.         }
  499.         else
  500.         {
  501.             ShowPlayerDialog(playerid, SpeedBoostDialog[4], DIALOG_STYLE_MSGBOX, "Notice", "You need to log in for using this command. (/login)", "ok", "");
  502.         }
  503.        
  504.  
  505.         return 1;
  506.     }
  507.    
  508.  
  509.     if (strcmp("/Gravity", cmdtext, true, 10) == 0)
  510.     {
  511.         if(PlayerAdmin[playerid]==1)
  512.         {
  513.             ShowPlayerDialog(playerid, GravityDialog[0], DIALOG_STYLE_INPUT, "Gravity", "Enter value between -10 and 10", "ok", "Cancel");
  514.         }
  515.         else
  516.         {
  517.             SendClientMessage(playerid, 0x00FFFFFF, "You need admin for this command.");
  518.         }
  519.         return 1;
  520.     }
  521.  
  522.     if (strcmp("/PlayAudio", cmdtext, true, 10) == 0)
  523.     {
  524.         if(PlayerAdmin[playerid]==1)
  525.         {
  526.             ShowPlayerDialog(playerid, AudioDialog[0], DIALOG_STYLE_INPUT, "Audio", "Enter AudioStream", "ok", "Cancel");
  527.         }
  528.         else
  529.         {
  530.             SendClientMessage(playerid, 0x00FFFFFF, "You need admin for this command.");
  531.         }
  532.         return 1;
  533.     }
  534.  
  535.     if (strcmp("/register", cmdtext, true, 10) == 0)
  536.     {
  537.    
  538.    
  539.         new file[128], pname[MAX_PLAYER_NAME];
  540.         GetPlayerName(playerid, pname, sizeof(pname));
  541.         format(file, sizeof(file), "\\Users\\%s.ini", pname);
  542.  
  543.         if(dini_Int(file, "Register") == 0)
  544.         {
  545.             ShowPlayerDialog(playerid, RegisterDialog[1], DIALOG_STYLE_INPUT, "Register:", "Enter a password\n[Passwords must be at least eight characters]", "ok", "Cancel");
  546.         }
  547.         else
  548.         {
  549.             ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "User already registered.", "ok", "");
  550.         }
  551.        
  552.         return 1;
  553.     }
  554.    
  555.    
  556.     if (strcmp("/login", cmdtext, true, 10) == 0)
  557.     {
  558.  
  559.  
  560.         new file[128], pname[MAX_PLAYER_NAME];
  561.         GetPlayerName(playerid, pname, sizeof(pname));
  562.         format(file, sizeof(file), "\\Users\\%s.ini", pname);
  563.  
  564.         if(PlyLogin[playerid] == 0)
  565.         {
  566.             ShowPlayerDialog(playerid, RegisterDialog[2], DIALOG_STYLE_INPUT, "Login", "Enter a password", "ok", "Cancel");
  567.         }
  568.         else if(dini_Int(file, "Register") == 0)
  569.         {
  570.             ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "You must first /register", "ok", "");
  571.         }
  572.         else if(PlyLogin[playerid] == 1)
  573.         {
  574.             ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "User already logged in.", "ok", "");
  575.         }
  576.  
  577.         return 1;
  578.     }
  579.    
  580.     if ((strcmp("/w", cmdtext, true, 10) == 0) || (strcmp("/wep", cmdtext, true, 10) == 0) || (strcmp("/weapon", cmdtext, true, 10) == 0))
  581.     {
  582.         ShowPlayerDialog(playerid,WeaponDialog[0], DIALOG_STYLE_LIST, "Select category", "Melee\nThrown\nPistols\nShotguns\nSub-machine guns\nAssault rifles\nRifles\nHeavy weapons\nHand held\nApparel", "Enter", "Cancel");
  583.         return 1;
  584.     }
  585.    
  586.    
  587.     if (strcmp("/gangset1", cmdtext, true, 10) == 0)
  588.     {
  589.         GangZoneDestroy(Gangz);
  590.         new Float:x,Float:y,Float:z;
  591.         GetPlayerPos(playerid,x,y,z);
  592.         ux = x;
  593.         uy = y;
  594.         return 1;
  595.     }
  596.    
  597.     if (strcmp("/gangset2", cmdtext, true, 10) == 0)
  598.     {
  599.         GangZoneDestroy(Gangz);
  600.         new Float:x,Float:y,Float:z;
  601.         GetPlayerPos(playerid,x,y,z);
  602.         dx = x;
  603.         dy = y;
  604.         return 1;
  605.     }
  606.     if (strcmp("/gangcreate", cmdtext, true, 10) == 0)
  607.     {
  608.         Gangz = GangZoneCreate(ux, uy, dx, dy);
  609.         for (new i = 0; i < MAX_PLAYERS; i++)
  610.         {
  611.            
  612.             GangZoneShowForPlayer(i, Gangz, 0xFFFF0096);
  613.         }
  614.         new string[64];
  615.         format(string,sizeof(string),"GangZone: %f, %f, %f, %f",ux, uy, dx, dy);
  616.         SendClientMessageToAll(-1, string);
  617.         return 1;
  618.     }
  619.    
  620.     if (strcmp("/bank", cmdtext, true, 10) == 0)
  621.     {
  622.         if(PlyLogin[playerid] == 1)
  623.         {
  624.             ShowPlayerDialog(playerid,BankDialog[2], DIALOG_STYLE_LIST, "Bank", "Deposit/Withdraw\nTransfer", "Enter", "Cancel");
  625.        
  626.  
  627.         }
  628.         else
  629.         {
  630.             ShowPlayerDialog(playerid, BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You need to log in for using this command. (/login)", "ok", "");
  631.         }
  632.         return 1;
  633.     }
  634.    
  635.    
  636.     if (strcmp("/loto", cmdtext, true, 10) == 0)
  637.     {
  638.         ShowPlayerDialog(playerid, LotoDialog[0], DIALOG_STYLE_INPUT, "Loto ticket: $50", "Give six numbers between 0 and 10 separated by a space.\n(example: '7 10 8 1 0 2')", "ok", "Cancel");
  639.         return 1;
  640.     }
  641.    
  642.     if (strcmp("/cmd", cmdtext, true, 10) == 0)
  643.     {
  644.         new string[200] = "";
  645.         if(PlayerAdmin[playerid]==1)
  646.         {
  647.             format(string,sizeof(string),"======Admin======\n/Gravity\n/PlayAudio\n/Flymode\n");
  648.         }
  649.         format(string,sizeof(string),"%s\n======Player=====\n/SSB\n/register\n/login\n/weapon | /wep | /w\n/bank\n/loto\n/cmd\n/Obj\n/PlyObj\n/AF\n/vehicle | /veh | /v\n/eject\n/flip\n/kill",string);
  650.         ShowPlayerDialog(playerid,CMDDialog[0], DIALOG_STYLE_LIST, "CMD", string, "Enter", "Cancel");
  651.         return 1;
  652.     }
  653.    
  654.     return 0;
  655. }
  656.  
  657.  
  658.  
  659.  
  660. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  661. {
  662.  
  663.  
  664.  
  665.     return 1;
  666. }
  667.  
  668.  
  669. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  670. {
  671.  
  672.     return 1;
  673. }
  674.  
  675. public OnPlayerExitVehicle(playerid, vehicleid)
  676. {
  677.     return 1;
  678. }
  679.  
  680. public OnPlayerStateChange(playerid, newstate, oldstate)
  681. {
  682.     return 1;
  683. }
  684.  
  685. public OnPlayerEnterCheckpoint(playerid)
  686. {
  687.     return 1;
  688. }
  689.  
  690. public OnPlayerLeaveCheckpoint(playerid)
  691. {
  692.     return 1;
  693. }
  694.  
  695. public OnPlayerEnterRaceCheckpoint(playerid)
  696. {
  697.     return 1;
  698. }
  699.  
  700. public OnPlayerLeaveRaceCheckpoint(playerid)
  701. {
  702.     return 1;
  703. }
  704.  
  705. public OnRconCommand(cmd[])
  706. {
  707.     return 1;
  708. }
  709.  
  710. public OnPlayerRequestSpawn(playerid)
  711. {
  712.     return 1;
  713. }
  714.  
  715. public OnObjectMoved(objectid)
  716. {
  717.     return 1;
  718. }
  719.  
  720. public OnPlayerObjectMoved(playerid, objectid)
  721. {
  722.     return 1;
  723. }
  724.  
  725. public OnPlayerPickUpPickup(playerid, pickupid)
  726. {
  727.     return 1;
  728. }
  729.  
  730. public OnVehicleMod(playerid, vehicleid, componentid)
  731. {
  732.     return 1;
  733. }
  734.  
  735. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  736. {
  737.     return 1;
  738. }
  739.  
  740. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  741. {
  742.     return 1;
  743. }
  744.  
  745. public OnPlayerSelectedMenuRow(playerid, row)
  746. {
  747.     return 1;
  748. }
  749.  
  750. public OnPlayerExitedMenu(playerid)
  751. {
  752.     return 1;
  753. }
  754.  
  755. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  756. {
  757.     return 1;
  758. }
  759.  
  760. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  761. {
  762.     if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  763.     {
  764.         if(newkeys & KEY_FIRE)
  765.         {
  766.             new Float:vx, Float:vy, Float:vz;
  767.             GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
  768.  
  769.             if (floatabs(vx) < 4 && floatabs(vy) < 4 && floatabs(vz) < 4)
  770.             {
  771.                 SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * SpeedBoostMultiplier[0][playerid], vy * SpeedBoostMultiplier[0][playerid], vz * SpeedBoostMultiplier[0][playerid]);
  772.             }
  773.             return 1;
  774.         }
  775.         else if (newkeys & KEY_CROUCH)
  776.         {
  777.             new Float:vx, Float:vy, Float:vz;
  778.             GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
  779.  
  780.             if (floatabs(vx) < 4 && floatabs(vy) < 4 && floatabs(vz) < 4)
  781.             {
  782.                 SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * SpeedBoostMultiplier[1][playerid], vy * SpeedBoostMultiplier[1][playerid], vz * SpeedBoostMultiplier[1][playerid]);
  783.             }
  784.             return 1;
  785.         }
  786.     }
  787.     return 1;
  788. }
  789.  
  790. public OnRconLoginAttempt(ip[], password[], success)
  791. {
  792.     return 1;
  793. }
  794.  
  795. public OnPlayerUpdate(playerid)
  796. {
  797.  
  798.     return 1;
  799. }
  800.  
  801. public OnPlayerStreamIn(playerid, forplayerid)
  802. {
  803.     return 1;
  804. }
  805.  
  806. public OnPlayerStreamOut(playerid, forplayerid)
  807. {
  808.     return 1;
  809. }
  810.  
  811. public OnVehicleStreamIn(vehicleid, forplayerid)
  812. {
  813.     return 1;
  814. }
  815.  
  816. public OnVehicleStreamOut(vehicleid, forplayerid)
  817. {
  818.     return 1;
  819. }
  820.  
  821. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  822. {
  823.  
  824.     if(dialogid == AdminDialog[1])
  825.     {
  826.         if(response)
  827.         {
  828.             if(listitem == 0)
  829.             {
  830.                 new Float:x, Float:y, Float:z;
  831.                 GetPlayerPos(clickply[playerid], x, y, z);
  832.                 TelePly(playerid,x+1, y+1, z);
  833.             }
  834.             if(listitem == 1)
  835.             {
  836.                 new Float:x, Float:y, Float:z;
  837.                 GetPlayerPos(playerid, x, y, z);
  838.                 TelePly(clickply[playerid],x+1, y+1, z);
  839.             }
  840.             if(listitem == 2)
  841.             {
  842.                 new Float:x, Float:y, Float:z;
  843.                 GetPlayerPos(clickply[playerid], x, y, z);
  844.                 CreateExplosion(x, y, z, 6, 10.0);
  845.             }
  846.             if(listitem == 3)
  847.             {
  848.                 SetPlayerHealth(clickply[playerid], 0);
  849.             }
  850.             if(listitem == 4)
  851.             {
  852.                 if(freezply[clickply[playerid]] == 0)
  853.                 {
  854.                     TogglePlayerControllable(clickply[playerid],0);
  855.                     freezply[clickply[playerid]] = 1;
  856.                 }
  857.                 else
  858.                 {
  859.                     TogglePlayerControllable(clickply[playerid],1);
  860.                     freezply[clickply[playerid]] = 0;
  861.                 }
  862.             }
  863.             if(listitem == 5)
  864.             {
  865.                 ShowPlayerDialog(playerid, AdminDialog[2], DIALOG_STYLE_INPUT, "Chat:", "Enter text", "ok", "Cancel");
  866.  
  867.             }
  868.             if(listitem == 6)
  869.             {
  870.                 ShowPlayerDialog(playerid, AdminDialog[3], DIALOG_STYLE_INPUT, "PM:", "Enter text", "ok", "Cancel");
  871.  
  872.             }
  873.             if(listitem == 7)
  874.             {
  875.                 Kick(clickply[playerid]);
  876.  
  877.             }
  878.  
  879.         }
  880.         return 1;
  881.     }
  882.    
  883.     if(dialogid == AdminDialog[2])
  884.     {
  885.         if(response)
  886.         {
  887.             new string[512];
  888.             format(string,sizeof(string),"{%06x}%s (%d):{ffffff} %s", GetPlayerColor(clickply[playerid]) >>> 8, GetPlyName(clickply[playerid]), clickply[playerid],inputtext);
  889.             SendClientMessageToAll(0xFFFFFFAA,string);
  890.  
  891.         }
  892.  
  893.         return 1;
  894.     }
  895.  
  896.     if(dialogid == AdminDialog[3])
  897.     {
  898.         if(response)
  899.         {
  900.             new string[512];
  901.             format(string,sizeof(string),"{ffffff}PM: {%06x}%s (%d):{ffffff} %s", GetPlayerColor(clickply[playerid]) >>> 8, GetPlyName(clickply[playerid]), clickply[playerid],inputtext);
  902.             SendClientMessage(clickply[playerid], 0xFFFFFFAA, string);
  903.  
  904.         }
  905.  
  906.         return 1;
  907.     }
  908. //=================speedboost
  909.  
  910.     if(dialogid == SpeedBoostDialog[0])
  911.     {
  912.         if(response)
  913.         {
  914.             if(floatstr(inputtext) >= -2.0 && floatstr(inputtext) <= 4.0)
  915.             {
  916.                 SpeedBoostMultiplier[0][playerid]=floatstr(inputtext);
  917.             }
  918.             else
  919.             {
  920.                 ShowPlayerDialog(playerid, SpeedBoostDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You must enter a value between -2.0 and 4.0", "Ok", "");
  921.             }
  922.  
  923.         }
  924.  
  925.         return 1;
  926.     }
  927.    
  928.     if(dialogid == SpeedBoostDialog[2])
  929.     {
  930.         if(response)
  931.         {
  932.             if(floatstr(inputtext) >= -2.0 && floatstr(inputtext) <= 4.0)
  933.             {
  934.                 SpeedBoostMultiplier[1][playerid]=floatstr(inputtext);
  935.             }
  936.             else
  937.             {
  938.                 ShowPlayerDialog(playerid, SpeedBoostDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You must enter a value between -2.0 and 4.0", "Ok", "");
  939.             }
  940.  
  941.         }
  942.  
  943.         return 1;
  944.     }
  945.  
  946.     if(dialogid == SpeedBoostDialog[3])
  947.     {
  948.         if(response)
  949.         {
  950.             if(listitem == 0)
  951.             {
  952.                 new ssbs[45];
  953.                 format(ssbs,sizeof(ssbs),"Enter value between -2.0 and 4.0\nCurrent: %.2f",SpeedBoostMultiplier[0][playerid]);
  954.                 ShowPlayerDialog(playerid, SpeedBoostDialog[0], DIALOG_STYLE_INPUT, "Speedboost multiplier", ssbs, "ok", "Cancel");
  955.            
  956.             }
  957.             else if(listitem == 1)
  958.             {
  959.                 new ssbs[45];
  960.                 format(ssbs,sizeof(ssbs),"Enter value between -2.0 and 4.0\nCurrent: %.2f",SpeedBoostMultiplier[1][playerid]);
  961.                 ShowPlayerDialog(playerid, SpeedBoostDialog[2], DIALOG_STYLE_INPUT, "Speedboost multiplier", ssbs, "ok", "Cancel");
  962.  
  963.             }
  964.  
  965.         }
  966.  
  967.         return 1;
  968.     }
  969.  
  970. //==============================register
  971.     if(dialogid == RegisterDialog[1])
  972.     {
  973.         if(response)
  974.         {
  975.             if((strlen(inputtext) >= 8 && strlen(inputtext) <= 25))
  976.             {
  977.                 new file[128], pname[MAX_PLAYER_NAME];
  978.                 GetPlayerName(playerid, pname, sizeof(pname));
  979.                 format(file, sizeof(file), "\\Users\\%s.ini", pname);
  980.  
  981.                 dini_Set(file, "Pass", inputtext);
  982.  
  983.                 dini_IntSet(file, "Register", 1);
  984.                
  985.                 new string[128];
  986.                 format(string, sizeof(string), "You succesfully registered the nickname %s with password %s", pname, inputtext);
  987.                 ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", string, "ok", "");
  988.  
  989.             }
  990.             else
  991.             {
  992.                 ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "Password must between 8 and 25 characters!", "ok", "");
  993.             }
  994.            
  995.  
  996.         }
  997.  
  998.         return 1;
  999.     }
  1000.  
  1001.     if(dialogid == RegisterDialog[2])
  1002.     {
  1003.         if(response)
  1004.         {
  1005.             if((strlen(inputtext) >= 8 && strlen(inputtext) <= 25))
  1006.             {
  1007.            
  1008.                 new file[128], pname[MAX_PLAYER_NAME];
  1009.                 GetPlayerName(playerid, pname, sizeof(pname));
  1010.                 format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1011.  
  1012.  
  1013.                 if(strcmp(dini_Get(file, "Password"), inputtext) == 0)
  1014.                 {
  1015.                     ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "You have succesfully logged in!", "ok", "");
  1016.                     new plrIP[16];
  1017.                     GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  1018.                     dini_Set(file, "Ip", plrIP);
  1019.                     IsPLYLoggedIn(playerid);
  1020.                 }
  1021.                 else
  1022.                 {
  1023.                     ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "Wrong Password", "ok", "");
  1024.                 }
  1025.                
  1026.  
  1027.             }
  1028.             else
  1029.             {
  1030.                 ShowPlayerDialog(playerid, RegisterDialog[0], DIALOG_STYLE_MSGBOX, "Notice", "Password must between 8 and 25 characters!", "ok", "");
  1031.             }
  1032.  
  1033.  
  1034.         }
  1035.  
  1036.         return 1;
  1037.     }
  1038. //=======weapon menu==========================================
  1039.  
  1040.     if(dialogid == WeaponDialog[0])
  1041.     {
  1042.         if(response)
  1043.         {
  1044.             new WeaponString[250];
  1045.             if(listitem == 0)//Melee
  1046.             {
  1047.                 for(new w=1; w<15+1; w++)
  1048.                 {
  1049.                
  1050.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[w][Name],WeaponList[w][Prices]);
  1051.                     ShowPlayerDialog(playerid,WeaponDialog[1], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1052.  
  1053.                 }
  1054.             }
  1055.             else if(listitem == 1)//Thrown
  1056.             {
  1057.                 for(new w=1; w<4+1; w++)
  1058.                 {
  1059.                     new wepid[5]={0,16,17,18,39};
  1060.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1061.                     ShowPlayerDialog(playerid,WeaponDialog[2], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1062.  
  1063.                 }
  1064.             }
  1065.             else if(listitem == 2)//Pistols
  1066.             {
  1067.                 for(new w=1; w<2+1; w++)
  1068.                 {
  1069.                     new wepid[5]={0,22,23};
  1070.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1071.                     ShowPlayerDialog(playerid,WeaponDialog[3], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1072.  
  1073.                 }
  1074.             }
  1075.             else if(listitem == 3)//Shotguns
  1076.             {
  1077.                 for(new w=1; w<3+1; w++)
  1078.                 {
  1079.                     new wepid[5]={0,25,26,27};
  1080.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1081.                     ShowPlayerDialog(playerid,WeaponDialog[4], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1082.  
  1083.                 }
  1084.             }
  1085.             else if(listitem == 4)//Sub-machine guns
  1086.             {
  1087.                 for(new w=1; w<3+1; w++)
  1088.                 {
  1089.                     new wepid[5]={0,28,29,32};
  1090.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1091.                     ShowPlayerDialog(playerid,WeaponDialog[5], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1092.  
  1093.                 }
  1094.             }
  1095.             else if(listitem == 5)//Assault rifles
  1096.             {
  1097.                 for(new w=1; w<2+1; w++)
  1098.                 {
  1099.                     new wepid[5]={0,30,31};
  1100.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1101.                     ShowPlayerDialog(playerid,WeaponDialog[6], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1102.  
  1103.                 }
  1104.             }
  1105.             else if(listitem == 6)//Rifles
  1106.             {
  1107.                 for(new w=1; w<2+1; w++)
  1108.                 {
  1109.                     new wepid[5]={0,33,34};
  1110.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1111.                     ShowPlayerDialog(playerid,WeaponDialog[7], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1112.  
  1113.                 }
  1114.             }
  1115.             else if(listitem == 7)//Heavy weapons
  1116.             {
  1117.                 for(new w=1; w<4+1; w++)
  1118.                 {
  1119.                     new wepid[5]={0,35,36,37,38};
  1120.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1121.                     ShowPlayerDialog(playerid,WeaponDialog[8], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1122.  
  1123.                 }
  1124.             }
  1125.             else if(listitem == 8)//Hand held
  1126.             {
  1127.                 for(new w=1; w<3+1; w++)
  1128.                 {
  1129.                     new wepid[5]={0,41,42,43};
  1130.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1131.                     ShowPlayerDialog(playerid,WeaponDialog[9], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1132.  
  1133.                 }
  1134.             }
  1135.             else if(listitem == 9)//Apparel
  1136.             {
  1137.                 for(new w=1; w<1+1; w++)
  1138.                 {
  1139.                     new wepid[5]={0,46};
  1140.                     format(WeaponString,sizeof(WeaponString), "%s\n%s ($%d)",WeaponString, WeaponList[wepid[w]][Name],WeaponList[wepid[w]][Prices]);
  1141.                     ShowPlayerDialog(playerid,WeaponDialog[10], DIALOG_STYLE_LIST, "Select weapon", WeaponString, "Enter", "Back");
  1142.  
  1143.                 }
  1144.             }
  1145.             WeaponDiaString[playerid] = WeaponString;
  1146.            
  1147.            
  1148.            
  1149.        
  1150.             //ShowPlayerDialog(playerid,WeaponDialog[0], DIALOG_STYLE_LIST, "Select category", "Melee\nThrown\nPistols\nShotguns\nSub-machine guns\nAssault rifles\nRifles\nHeavy weapons\nHand held\nApparel", "Enter", "Cancel");
  1151.  
  1152.         }
  1153.  
  1154.         return 1;
  1155.     }
  1156.    
  1157.     if((dialogid == WeaponDialog[1]) || (dialogid == WeaponDialog[2])|| (dialogid == WeaponDialog[3])|| (dialogid == WeaponDialog[4])|| (dialogid == WeaponDialog[5])||(dialogid == WeaponDialog[6])|| (dialogid == WeaponDialog[7])|| (dialogid == WeaponDialog[8])|| (dialogid == WeaponDialog[9])|| (dialogid == WeaponDialog[10]))
  1158.     {
  1159.         if(!response){ShowPlayerDialog(playerid,WeaponDialog[0], DIALOG_STYLE_LIST, "Select category", "Melee\nThrown\nPistols\nShotguns\nSub-machine guns\nAssault rifles\nRifles\nHeavy weapons\nHand held\nApparel", "Enter", "Cancel");}
  1160.     }
  1161.    
  1162.  
  1163.     if(dialogid == WeaponDialog[1])
  1164.     {
  1165.         if(response)
  1166.         {
  1167.        
  1168.             new wepid[16]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
  1169.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1170.            
  1171.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1172.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1173.             ShowPlayerDialog(playerid,WeaponDialog[1], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1174.         }
  1175.        
  1176.         return 1;
  1177.     }
  1178.     if(dialogid == WeaponDialog[2])
  1179.     {
  1180.         if(response)
  1181.         {
  1182.  
  1183.             new wepid[5]={0,16,17,18,39};
  1184.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1185.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1186.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1187.             ShowPlayerDialog(playerid,WeaponDialog[2], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1188.  
  1189.         }
  1190.  
  1191.         return 1;
  1192.     }
  1193.     if(dialogid == WeaponDialog[3])
  1194.     {
  1195.         if(response)
  1196.         {
  1197.  
  1198.             new wepid[5]={0,22,23};
  1199.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1200.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1201.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1202.             ShowPlayerDialog(playerid,WeaponDialog[3], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1203.  
  1204.         }
  1205.  
  1206.         return 1;
  1207.     }
  1208.     if(dialogid == WeaponDialog[4])
  1209.     {
  1210.         if(response)
  1211.         {
  1212.  
  1213.             new wepid[5]={0,25,26,27};
  1214.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1215.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1216.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1217.             ShowPlayerDialog(playerid,WeaponDialog[4], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1218.  
  1219.         }
  1220.  
  1221.         return 1;
  1222.     }
  1223.     if(dialogid == WeaponDialog[5])
  1224.     {
  1225.         if(response)
  1226.         {
  1227.  
  1228.             new wepid[5]={0,28,29,32};
  1229.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1230.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1231.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1232.             ShowPlayerDialog(playerid,WeaponDialog[5], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1233.  
  1234.         }
  1235.         return 1;
  1236.     }
  1237.     if(dialogid == WeaponDialog[6])
  1238.     {
  1239.         if(response)
  1240.         {
  1241.  
  1242.             new wepid[5]={0,30,31};
  1243.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1244.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1245.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1246.             ShowPlayerDialog(playerid,WeaponDialog[6], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1247.  
  1248.         }
  1249.         return 1;
  1250.     }
  1251.     if(dialogid == WeaponDialog[7])
  1252.     {
  1253.         if(response)
  1254.         {
  1255.             new wepid[5]={0,33,34};
  1256.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1257.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1258.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1259.             ShowPlayerDialog(playerid,WeaponDialog[7], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1260.  
  1261.         }
  1262.         return 1;
  1263.     }
  1264.     if(dialogid == WeaponDialog[8])
  1265.     {
  1266.         if(response)
  1267.         {
  1268.             new wepid[5]={0,35,36,37,38};
  1269.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1270.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1271.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1272.             ShowPlayerDialog(playerid,WeaponDialog[8], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1273.  
  1274.         }
  1275.         return 1;
  1276.     }
  1277.     if(dialogid == WeaponDialog[9])
  1278.     {
  1279.         if(response)
  1280.         {
  1281.             new wepid[5]={0,41,42,43};
  1282.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1283.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1284.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1285.             ShowPlayerDialog(playerid,WeaponDialog[9], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1286.  
  1287.         }
  1288.         return 1;
  1289.     }
  1290.     if(dialogid == WeaponDialog[10])
  1291.     {
  1292.         if(response)
  1293.         {
  1294.             new wepid[5]={0,46};
  1295.             if(GetPlayerMoney(playerid) < WeaponList[wepid[listitem+1]][Prices]) return ShowPlayerDialog(playerid,WeaponDialog[11], DIALOG_STYLE_MSGBOX, "Notice", "you don't have enough money.", "Ok", "");
  1296.             GivePlayerWeapon(playerid, wepid[listitem+1], WeaponList[wepid[listitem+1]][Ammo]);
  1297.             GivePlayerMoney(playerid, - WeaponList[wepid[listitem+1]][Prices]);
  1298.             ShowPlayerDialog(playerid,WeaponDialog[10], DIALOG_STYLE_LIST, "Select weapon", WeaponDiaString[playerid], "Enter", "Back");
  1299.  
  1300.         }
  1301.         return 1;
  1302.     }
  1303.    
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.             //ShowPlayerDialog(playerid,WeaponDialog[0], DIALOG_STYLE_LIST, "Select category", "Melee\nThrown\nPistols\nShotguns\nSub-machine guns\nAssault rifles\nRifles\nHeavy weapons\nHand held\nApparel", "Enter", "Cancel");
  1310.  
  1311.  
  1312.  
  1313.  
  1314. //========================gravity
  1315.  
  1316.  
  1317.  
  1318.     if(dialogid == GravityDialog[0])
  1319.     {
  1320.         if(response)
  1321.         {
  1322.             if(floatstr(inputtext) >= -10.0 && floatstr(inputtext) <= 10.0)
  1323.             {
  1324.                 SetGravity(floatstr(inputtext));
  1325.             }
  1326.             else
  1327.             {
  1328.                 ShowPlayerDialog(playerid, SpeedBoostDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You must enter a value between -10.0 and 10.0", "Ok", "");
  1329.             }
  1330.  
  1331.         }
  1332.  
  1333.         return 1;
  1334.     }
  1335. //======================AudioStream
  1336.     if(dialogid == AudioDialog[0])
  1337.     {
  1338.         if(response)
  1339.         {
  1340.             for(new i; i<MAX_PLAYERS+1; i++)
  1341.             {
  1342.                 if (!IsPlayerNPC(i))
  1343.                 {
  1344.                     PlayAudioStreamForPlayer(i, inputtext);
  1345.                 }
  1346.             }
  1347.         }
  1348.  
  1349.         return 1;
  1350.     }
  1351. //=======================bank
  1352.  
  1353.  
  1354.  
  1355.     if(dialogid == BankDialog[2])
  1356.     {
  1357.         if(response)
  1358.         {
  1359.  
  1360.             new file[128], pname[MAX_PLAYER_NAME];
  1361.             GetPlayerName(playerid, pname, sizeof(pname));
  1362.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1363.             if(listitem == 0)//Deposit/Withdraw
  1364.             {
  1365.  
  1366.  
  1367.  
  1368.                 new Title[64];
  1369.                 format(Title,sizeof(Title),"Deposit/Withdraw | Current money: $%d",floatround(dini_Float(file, "Bank"), floatround_round));
  1370.  
  1371.  
  1372.                 ShowPlayerDialog(playerid,BankDialog[0], DIALOG_STYLE_LIST, Title, "-$500\n-$1000\n-$2500\n-$5000\n-$10000\n-$50000\n-All\n \n+$500\n+$1000\n+$2500\n+$5000\n+$10000\n+$50000\n+All", "Enter", "Cancel");
  1373.             }
  1374.             else if(listitem == 1)//transfer
  1375.             {
  1376.            
  1377.                 new Title[64];
  1378.                 format(Title,sizeof(Title),"Transfer | Current money: $%d",floatround(dini_Float(file, "Bank"), floatround_round));
  1379.                 ShowPlayerDialog(playerid,BankDialog[3], DIALOG_STYLE_INPUT, Title, "Enter player name or ID.", "Enter", "Cancel");
  1380.  
  1381.            
  1382.            
  1383.             }
  1384.  
  1385.         }
  1386.  
  1387.         return 1;
  1388.     }
  1389.    
  1390.     if(dialogid == BankDialog[3])
  1391.     {
  1392.         if(response)
  1393.         {
  1394.             new file[128], pname[MAX_PLAYER_NAME];
  1395.             GetPlayerName(playerid, pname, sizeof(pname));
  1396.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1397.             new id;
  1398.             if(sscanf(inputtext, "u", id)) return ShowPlayerDialog(playerid, BankDialog[5], DIALOG_STYLE_MSGBOX, "Notice", "Enter player name or ID.", "Ok", "");
  1399.             if(!IsPlayerConnected(id)) return ShowPlayerDialog(playerid, BankDialog[5], DIALOG_STYLE_MSGBOX, "Notice", "This player is offline.", "Ok", "");
  1400.             if(IsPlayerNPC(id)) return ShowPlayerDialog(playerid, BankDialog[5], DIALOG_STYLE_MSGBOX, "Notice", "This player is an NPC.", "Ok", "");
  1401.            
  1402.             new Title[180];
  1403.             format(Title,sizeof(Title),"Transfer | Current money: $%d",floatround(dini_Float(file, "Bank"), floatround_round));
  1404.             new Text[180];
  1405.             format(Text,sizeof(Text),"{FFFFFF}You will transfer money to {00FF00}%s (%d).{FFFFFF} If this incorrect, hit the back button.\n \nEnter the amount of money you want to transfer.\n(example: '1500')",GetPlyName(id),id);
  1406.             MoneyransferID[playerid] = id;
  1407.             ShowPlayerDialog(playerid,BankDialog[4], DIALOG_STYLE_INPUT, Title, Text, "Enter", "Back");
  1408.         }
  1409.  
  1410.         return 1;
  1411.     }
  1412.    
  1413.     if(dialogid == BankDialog[4])
  1414.     {
  1415.         new file[128], pname[MAX_PLAYER_NAME], Text[180],Textt[180];
  1416.         GetPlayerName(playerid, pname, sizeof(pname));
  1417.         format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1418.         if(response)
  1419.         {
  1420.  
  1421.             new money;
  1422.             if(sscanf(inputtext, "i", money)) return ShowPlayerDialog(playerid, BankDialog[6], DIALOG_STYLE_MSGBOX, "Notice", "Enter the amount of money you want to transfer. (example: '1500')", "Ok", "");
  1423.             if(dini_Float(file, "Bank") < money) return ShowPlayerDialog(playerid,BankDialog[6], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1424.             if(money < 50) return ShowPlayerDialog(playerid,BankDialog[6], DIALOG_STYLE_MSGBOX, "Notice", "You can only give money above $50", "OK", "");
  1425.             dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-money);
  1426.             GetPlayerName(MoneyransferID[playerid], pname, sizeof(pname));
  1427.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1428.             dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+money);
  1429.             format(Text,sizeof(Text),"{FFFFFF}You have successfully transfer $%d to {00FF00}%s (%d)",money,GetPlyName(MoneyransferID[playerid]),MoneyransferID[playerid]);
  1430.             ShowPlayerDialog(playerid,BankDialog[7], DIALOG_STYLE_MSGBOX, "Notice", Text , "Enter", "");
  1431.             format(Textt,sizeof(Textt),"%s (%d) have transfer $%d to you.",GetPlyName(playerid),playerid,money);
  1432.             SendClientMessage(MoneyransferID[playerid], -1, Textt);
  1433.         }
  1434.         else
  1435.         {
  1436.                 new Title[64];
  1437.                 format(Title,sizeof(Title),"Transfer | Current money: $%d",floatround(dini_Float(file, "Bank"), floatround_round));
  1438.                 ShowPlayerDialog(playerid,BankDialog[3], DIALOG_STYLE_INPUT, Title, "Enter player name or ID.", "Enter", "Cancel");
  1439.        
  1440.         }
  1441.  
  1442.         return 1;
  1443.     }
  1444.    
  1445.     if(dialogid == BankDialog[5])
  1446.     {
  1447.         if(response)
  1448.         {
  1449.             new file[128], pname[MAX_PLAYER_NAME];
  1450.             GetPlayerName(playerid, pname, sizeof(pname));
  1451.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1452.             new Title[64];
  1453.             format(Title,sizeof(Title),"Transfer | Current money: $%d",floatround(dini_Float(file, "Bank"), floatround_round));
  1454.             ShowPlayerDialog(playerid,BankDialog[3], DIALOG_STYLE_INPUT, Title, "Enter player name or ID.", "Enter", "Cancel");
  1455.  
  1456.         }
  1457.  
  1458.         return 1;
  1459.     }
  1460.    
  1461.     if(dialogid == BankDialog[6])
  1462.     {
  1463.         if(response)
  1464.         {
  1465.             ShowPlayerDialog(playerid,BankDialog[4], DIALOG_STYLE_MSGBOX, "Notice", "Enter the amount of money you want to transfer.\n(example: '1500')", "Enter", "Back");
  1466.  
  1467.         }
  1468.  
  1469.         return 1;
  1470.     }
  1471.  
  1472.     if(dialogid == BankDialog[1])
  1473.     {
  1474.         if(response)
  1475.         {
  1476.  
  1477.             new file[128], pname[MAX_PLAYER_NAME];
  1478.             GetPlayerName(playerid, pname, sizeof(pname));
  1479.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1480.             new Title[64];
  1481.             format(Title,sizeof(Title),"Current money: $%d",dini_Int(file, "Bank"));
  1482.             ShowPlayerDialog(playerid,BankDialog[0], DIALOG_STYLE_LIST, Title, "-$500\n-$1000\n-$2500\n-$5000\n-$10000\n-$50000\n-All\n \n+$500\n+$1000\n+$2500\n+$5000\n+$10000\n+$50000\n+All", "Enter", "Cancel");
  1483.  
  1484.         }
  1485.  
  1486.         return 1;
  1487.     }
  1488.  
  1489.  
  1490.  
  1491.     if(dialogid == BankDialog[0])
  1492.     {
  1493.         if(response)
  1494.         {
  1495.             new file[128], pname[MAX_PLAYER_NAME];
  1496.             GetPlayerName(playerid, pname, sizeof(pname));
  1497.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1498.        
  1499.             if(listitem == 0)//-500
  1500.             {
  1501.                 if(GetPlayerMoney(playerid) < 500) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1502.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+500);
  1503.                 GivePlayerMoney(playerid, -500);
  1504.             }
  1505.             if(listitem == 1)//-1000
  1506.             {
  1507.                 if(GetPlayerMoney(playerid) < 1000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1508.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+1000);
  1509.                 GivePlayerMoney(playerid, -1000);
  1510.             }
  1511.             if(listitem == 2)//-2500
  1512.             {
  1513.                 if(GetPlayerMoney(playerid) < 2500) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1514.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+2500);
  1515.                 GivePlayerMoney(playerid, -2500);
  1516.             }
  1517.             if(listitem == 3)//-5000
  1518.             {
  1519.                 if(GetPlayerMoney(playerid) < 5000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1520.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+5000);
  1521.                 GivePlayerMoney(playerid, -5000);
  1522.             }
  1523.             if(listitem == 4)//-10000
  1524.             {
  1525.                 if(GetPlayerMoney(playerid) < 10000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1526.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+10000);
  1527.                 GivePlayerMoney(playerid, -10000);
  1528.             }
  1529.             if(listitem == 5)//-50000
  1530.             {
  1531.                 if(GetPlayerMoney(playerid) < 50000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1532.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+50000);
  1533.                 GivePlayerMoney(playerid, -50000);
  1534.             }
  1535.             if(listitem == 6)//-all
  1536.             {
  1537.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")+GetPlayerMoney(playerid));
  1538.                 ResetPlayerMoney(playerid);
  1539.             }
  1540.             if(listitem == 7)//-nono
  1541.             {
  1542.            
  1543.  
  1544.             }
  1545.            
  1546.            
  1547.             if(listitem == 8)//+500
  1548.             {
  1549.                 if(floatround(dini_Float(file, "Bank"), floatround_round) < 500) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1550.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-500.0);
  1551.                 GivePlayerMoney(playerid, 500);
  1552.             }
  1553.             if(listitem == 9)//+1000
  1554.             {
  1555.                 if(floatround(dini_Float(file, "Bank"), floatround_round) < 1000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1556.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-1000.0);
  1557.                 GivePlayerMoney(playerid, 1000);
  1558.             }
  1559.             if(listitem == 10)//+2500
  1560.             {
  1561.                 if(floatround(dini_Float(file, "Bank"), floatround_round) < 2500) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1562.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-2500.0);
  1563.                 GivePlayerMoney(playerid, 2500);
  1564.             }
  1565.             if(listitem == 11)//+5000
  1566.             {
  1567.                 if(floatround(dini_Float(file, "Bank"), floatround_round) < 5000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1568.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-5000.0);
  1569.                 GivePlayerMoney(playerid, 5000);
  1570.             }
  1571.             if(listitem == 12)//+10000
  1572.             {
  1573.                 if(floatround(dini_Float(file, "Bank"), floatround_round) < 10000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1574.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-10000.0);
  1575.                 GivePlayerMoney(playerid, 10000);
  1576.             }
  1577.             if(listitem == 13)//+50000
  1578.             {
  1579.                 if(floatround(dini_Float(file, "Bank"), floatround_round) < 50000) return ShowPlayerDialog(playerid,BankDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money.", "OK", "");
  1580.                 dini_FloatSet(file, "Bank", dini_Float(file, "Bank")-50000.0);
  1581.                 GivePlayerMoney(playerid, 50000);
  1582.             }
  1583.             if(listitem == 14)//+all
  1584.             {
  1585.                 GivePlayerMoney(playerid, floatround(dini_Float(file, "Bank"), floatround_round));
  1586.                 dini_FloatSet(file, "Bank", 0.0);
  1587.             }
  1588.            
  1589.             new Title[64];
  1590.             format(Title,sizeof(Title),"Current money: $%d",dini_Int(file, "Bank"));
  1591.  
  1592.             ShowPlayerDialog(playerid,BankDialog[0], DIALOG_STYLE_LIST, Title, "-$500\n-$1000\n-$2500\n-$5000\n-$10000\n-$50000\n-All\n \n+$500\n+$1000\n+$2500\n+$5000\n+$10000\n+$50000\n+All", "Enter", "Cancel");
  1593.  
  1594.  
  1595.         }
  1596.  
  1597.         return 1;
  1598.     }
  1599.    
  1600.    
  1601.     if(dialogid == BankDialog[1])
  1602.     {
  1603.         if(response)
  1604.         {
  1605.             new file[128], pname[MAX_PLAYER_NAME];
  1606.             GetPlayerName(playerid, pname, sizeof(pname));
  1607.             format(file, sizeof(file), "\\Users\\%s.ini", pname);
  1608.             new Title[64];
  1609.             format(Title,sizeof(Title),"Current money: %d",floatround(dini_Float(file, "Bank"), floatround_round));
  1610.  
  1611.             ShowPlayerDialog(playerid,BankDialog[0], DIALOG_STYLE_LIST, Title, "-$500\n-$1000\n-$2500\n-$5000\n-$10000\n-$50000\n-All\n \n+$500\n+$1000\n+$2500\n+$5000\n+$10000\n+$50000\n+All", "Enter", "Cancel");
  1612.  
  1613.         }
  1614.  
  1615.         return 1;
  1616.     }
  1617.    
  1618.    
  1619.     if(dialogid == LotoDialog[0])
  1620.     {
  1621.         if(response)
  1622.         {
  1623.             new num1,num2,num3,num4,num5,num6;
  1624.             if(sscanf(inputtext, "iiiiii", num1,num2,num3,num4,num5,num6)) return ShowPlayerDialog(playerid,LotoDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "Give six numbers between 0 and 20 separated by a space.\n(example: '7 10 02 11 0 19')", "OK", "");
  1625.             if(((num1 >= 0)&&(num1 <= 10))&&((num2 >= 0)&&(num2 <= 10))&&((num3 >= 0)&&(num3 <= 10))&&((num4 >= 0)&&(num4 <= 10))&&((num5 >= 0)&&(num5 <= 10))&&((num6 >= 0)&&(num6 <= 10)))
  1626.             {
  1627.                 new tors[528];
  1628.                 new num1r,num2r,num3r,num4r,num5r,num6r;
  1629.                 num1r = randomEx(0, 11);
  1630.                 num2r = randomEx(0, 11);
  1631.                 num3r = randomEx(0, 11);
  1632.                 num4r = randomEx(0, 11);
  1633.                 num5r = randomEx(0, 11);
  1634.                 num6r = randomEx(0, 11);
  1635.  
  1636.                 new numbs=0;
  1637.                 format(tors,sizeof(tors),"{FFFFFF}    Ticket Num    |       WIN Num   \n----------------------------------------------",tors, num1,num1r);
  1638.  
  1639.                 if(num1 == num1r){format(tors,sizeof(tors),"%s\n{FFFFFF}1:  %02d    |   %02d {00FF00}V",tors,num1,num1r);numbs++;}else{format(tors,sizeof(tors),"%s\n{FFFFFF}1: %02d    |   %02d {FF0000}X",tors,num1,num1r);}
  1640.                 if(num2 == num2r){format(tors,sizeof(tors),"%s\n{FFFFFF}2:  %02d    |   %02d {00FF00}V",tors,num2,num2r);numbs++;}else{format(tors,sizeof(tors),"%s\n{FFFFFF}2: %02d    |   %02d {FF0000}X",tors,num2,num2r);}
  1641.                 if(num3 == num3r){format(tors,sizeof(tors),"%s\n{FFFFFF}3:  %02d    |   %02d {00FF00}V",tors,num3,num3r);numbs++;}else{format(tors,sizeof(tors),"%s\n{FFFFFF}3:     %02d    |   %02d {FF0000}X",tors,num3,num3r);}
  1642.                 if(num4 == num4r){format(tors,sizeof(tors),"%s\n{FFFFFF}4:  %02d    |   %02d {00FF00}V",tors,num4,num4r);numbs++;}else{format(tors,sizeof(tors),"%s\n{FFFFFF}4:     %02d    |   %02d {FF0000}X",tors,num4,num4r);}
  1643.                 if(num5 == num5r){format(tors,sizeof(tors),"%s\n{FFFFFF}5:  %02d    |   %02d {00FF00}V",tors,num5,num5r);numbs++;}else{format(tors,sizeof(tors),"%s\n{FFFFFF}5:     %02d    |   %02d {FF0000}X",tors,num5,num5r);}
  1644.                 if(num6 == num6r){format(tors,sizeof(tors),"%s\n{FFFFFF}6:  %02d    |   %02d {00FF00}V",tors,num6,num6r);numbs++;}else{format(tors,sizeof(tors),"%s\n{FFFFFF}6:     %02d    |   %02d {FF0000}X",tors,num6,num6r);}
  1645.                 format(tors,sizeof(tors),"%s\n{FFFFFF}----------------------------------------------\nTicket Price: -$50\n----------------------------------------------\nMatching groups: %d\n----------------------------------------------\nMoney Won: {00FF00}$%d",tors, numbs, floatround(floatpower(11,numbs), floatround_round));
  1646.  
  1647.                 GivePlayerMoney(playerid,-50);
  1648.                 GivePlayerMoney(playerid,floatround(floatpower(11,numbs), floatround_round));
  1649.                 ShowPlayerDialog(playerid,LotoDialog[2], DIALOG_STYLE_MSGBOX, "Ticket", tors, "OK", "");
  1650.                 if(floatround(floatpower(11,numbs), floatround_round) >= 5)
  1651.                 {
  1652.                     new string[64],pname[MAX_PLAYER_NAME];
  1653.                     GetPlayerName(playerid, pname, sizeof(pname));
  1654.                     format(string,sizeof(string),"%s won $%d by a '/loto' ticket.",pname,floatround(floatpower(11,numbs), floatround_round));
  1655.                     SendClientMessageToAll(0xFFFFFFAA,string);
  1656.  
  1657.                 }
  1658.             }
  1659.             else
  1660.             {
  1661.                 ShowPlayerDialog(playerid,LotoDialog[1], DIALOG_STYLE_MSGBOX, "Notice", "One of your numbers is not between 0 and 10!", "OK", "");
  1662.             }
  1663.  
  1664.         }
  1665.        
  1666.  
  1667.         return 1;
  1668.     }
  1669.    
  1670.     if(dialogid == LotoDialog[1])
  1671.     {
  1672.         if(response)
  1673.         {
  1674.  
  1675.  
  1676.         }
  1677.  
  1678.  
  1679.         return 1;
  1680.     }
  1681.    
  1682.    
  1683.     return 0;
  1684. }
  1685.  
  1686. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1687. {
  1688.  
  1689.     if(PlayerAdmin[playerid] == 1)
  1690.     {
  1691.         ShowPlayerDialog(playerid, AdminDialog[1], DIALOG_STYLE_LIST, "Admin:", "Goto\nGet\nExplode\nKill\nFreeze\nChat\nPm\nKick", "Ok", "Cancel");
  1692.         clickply[playerid] = clickedplayerid;
  1693.  
  1694.     }
  1695.     else
  1696.     {
  1697.        
  1698.     }
  1699.  
  1700.  
  1701.     return 1;
  1702. }
  1703.  
  1704. stock randomEx(min, max)
  1705. {
  1706.     //Credits to y_less
  1707.     new rand = random(max-min)+min;
  1708.     return rand;
  1709. }
  1710.  
  1711. stock sscanf(string[], format[], {Float,_}:...)
  1712. {
  1713.     #if defined isnull
  1714.         if (isnull(string))
  1715.     #else
  1716.         if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  1717.     #endif
  1718.         {
  1719.             return format[0];
  1720.         }
  1721.     #pragma tabsize 4
  1722.     new
  1723.         formatPos = 0,
  1724.         stringPos = 0,
  1725.         paramPos = 2,
  1726.         paramCount = numargs(),
  1727.         delim = ' ';
  1728.     while (string[stringPos] && string[stringPos] <= ' ')
  1729.     {
  1730.         stringPos++;
  1731.     }
  1732.     while (paramPos < paramCount && string[stringPos])
  1733.     {
  1734.         switch (format[formatPos++])
  1735.         {
  1736.             case '\0':
  1737.             {
  1738.                 return 0;
  1739.             }
  1740.             case 'i', 'd':
  1741.             {
  1742.                 new
  1743.                     neg = 1,
  1744.                     num = 0,
  1745.                     ch = string[stringPos];
  1746.                 if (ch == '-')
  1747.                 {
  1748.                     neg = -1;
  1749.                     ch = string[++stringPos];
  1750.                 }
  1751.                 do
  1752.                 {
  1753.                     stringPos++;
  1754.                     if ('0' <= ch <= '9')
  1755.                     {
  1756.                         num = (num * 10) + (ch - '0');
  1757.                     }
  1758.                     else
  1759.                     {
  1760.                         return -1;
  1761.                     }
  1762.                 }
  1763.                 while ((ch = string[stringPos]) > ' ' && ch != delim);
  1764.                 setarg(paramPos, 0, num * neg);
  1765.             }
  1766.             case 'h', 'x':
  1767.             {
  1768.                 new
  1769.                     ch,
  1770.                     num = 0;
  1771.                 while ((ch = string[stringPos]) > ' ' && ch != delim)
  1772.                 {
  1773.                     switch (ch)
  1774.                     {
  1775.                         case 'x', 'X':
  1776.                         {
  1777.                             num = 0;
  1778.                             continue;
  1779.                         }
  1780.                         case '0' .. '9':
  1781.                         {
  1782.                             num = (num << 4) | (ch - '0');
  1783.                         }
  1784.                         case 'a' .. 'f':
  1785.                         {
  1786.                             num = (num << 4) | (ch - ('a' - 10));
  1787.                         }
  1788.                         case 'A' .. 'F':
  1789.                         {
  1790.                             num = (num << 4) | (ch - ('A' - 10));
  1791.                         }
  1792.                         default:
  1793.                         {
  1794.                             return -1;
  1795.                         }
  1796.                     }
  1797.                 }
  1798.                 setarg(paramPos, 0, num);
  1799.             }
  1800.             case 'c':
  1801.             {
  1802.                 setarg(paramPos, 0, string[stringPos++]);
  1803.             }
  1804.             case 'f':
  1805.             {
  1806.                 setarg(paramPos, 0, _:floatstr(string[stringPos]));
  1807.             }
  1808.             case 'p':
  1809.             {
  1810.                 delim = format[formatPos++];
  1811.                 continue;
  1812.             }
  1813.             case '\'':
  1814.             {
  1815.                 new
  1816.                     end = formatPos - 1,
  1817.                     ch;
  1818.                 while ((ch = format[++end]) && ch != '\'') {}
  1819.                 if (!ch)
  1820.                 {
  1821.                     return -1;
  1822.                 }
  1823.                 format[end] = '\0';
  1824.                 if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  1825.                 {
  1826.                     if (format[end + 1])
  1827.                     {
  1828.                         return -1;
  1829.                     }
  1830.                     return 0;
  1831.                 }
  1832.                 format[end] = '\'';
  1833.                 stringPos = ch + (end - formatPos);
  1834.                 formatPos = end + 1;
  1835.             }
  1836.             case 'u':
  1837.             {
  1838.                 new
  1839.                     end = stringPos - 1,
  1840.                     id = 0,
  1841.                     bool:num = true,
  1842.                     ch;
  1843.                 while ((ch = string[++end]) && ch != delim)
  1844.                 {
  1845.                     if (num)
  1846.                     {
  1847.                         if ('0' <= ch <= '9')
  1848.                         {
  1849.                             id = (id * 10) + (ch - '0');
  1850.                         }
  1851.                         else
  1852.                         {
  1853.                             num = false;
  1854.                         }
  1855.                     }
  1856.                 }
  1857.                 if (num && IsPlayerConnected(id))
  1858.                 {
  1859.                     setarg(paramPos, 0, id);
  1860.                 }
  1861.                 else
  1862.                 {
  1863.                     #if !defined foreach
  1864.                         #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  1865.                         #define __SSCANF_FOREACH__
  1866.                     #endif
  1867.                     string[end] = '\0';
  1868.                     num = false;
  1869.                     new
  1870.                         name[MAX_PLAYER_NAME];
  1871.                     id = end - stringPos;
  1872.                     foreach (Player, playerid)
  1873.                     {
  1874.                         GetPlayerName(playerid, name, sizeof (name));
  1875.                         if (!strcmp(name, string[stringPos], true, id))
  1876.                         {
  1877.                             setarg(paramPos, 0, playerid);
  1878.                             num = true;
  1879.                             break;
  1880.                         }
  1881.                     }
  1882.                     if (!num)
  1883.                     {
  1884.                         setarg(paramPos, 0, INVALID_PLAYER_ID);
  1885.                     }
  1886.                     string[end] = ch;
  1887.                     #if defined __SSCANF_FOREACH__
  1888.                         #undef foreach
  1889.                         #undef __SSCANF_FOREACH__
  1890.                     #endif
  1891.                 }
  1892.                 stringPos = end;
  1893.             }
  1894.             case 's', 'z':
  1895.             {
  1896.                 new
  1897.                     i = 0,
  1898.                     ch;
  1899.                 if (format[formatPos])
  1900.                 {
  1901.                     while ((ch = string[stringPos++]) && ch != delim)
  1902.                     {
  1903.                         setarg(paramPos, i++, ch);
  1904.                     }
  1905.                     if (!i)
  1906.                     {
  1907.                         return -1;
  1908.                     }
  1909.                 }
  1910.                 else
  1911.                 {
  1912.                     while ((ch = string[stringPos++]))
  1913.                     {
  1914.                         setarg(paramPos, i++, ch);
  1915.                     }
  1916.                 }
  1917.                 stringPos--;
  1918.                 setarg(paramPos, i, '\0');
  1919.             }
  1920.             default:
  1921.             {
  1922.                 continue;
  1923.             }
  1924.         }
  1925.         while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  1926.         {
  1927.             stringPos++;
  1928.         }
  1929.         while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  1930.         {
  1931.             stringPos++;
  1932.         }
  1933.         paramPos++;
  1934.     }
  1935.     do
  1936.     {
  1937.         if ((delim = format[formatPos++]) > ' ')
  1938.         {
  1939.             if (delim == '\'')
  1940.             {
  1941.                 while ((delim = format[formatPos++]) && delim != '\'') {}
  1942.             }
  1943.             else if (delim != 'z')
  1944.             {
  1945.                 return delim;
  1946.             }
  1947.         }
  1948.     }
  1949.     while (delim > ' ');
  1950.     return 0;
  1951. }
  1952.  
  1953. stock TelePly(playerid,Float:x,Float:y,Float:z,Float:a= 0.0)
  1954. {
  1955.     SetPlayerPos(playerid,x,y,z);
  1956.     SetPlayerFacingAngle( playerid, a );
  1957.     TogglePlayerControllable(playerid, 0);
  1958.     SetTimerEx("TelePlyTimer", 2000, 0, "d", playerid);
  1959.     GameTextForPlayer(playerid, "~g~Loading...", 2000, 3);
  1960.     return 1;
  1961. }
  1962.  
  1963. forward TelePlyTimer(playerid);
  1964. public TelePlyTimer(playerid)
  1965. {
  1966.     TogglePlayerControllable(playerid, 1);
  1967.     return 1;
  1968. }
  1969.  
  1970.  
  1971.  
  1972. stock GetPlyName(playerid)
  1973. {
  1974.     new name[MAX_PLAYER_NAME+1];
  1975.     GetPlayerName(playerid, name, sizeof(name));
  1976.     return name;
  1977. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement