SHARE
TWEET

Untitled

a guest Jul 11th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.                                        ATROX DM
  3.                                   v1.0 by Aggressive
  4. */
  5. //-------------------------------- INCLUDE FILES -----------------------------//
  6. #include < a_samp >
  7. #include < streamer >
  8. #include < a_mysql >
  9. #include < foreach >
  10. #include < Pawn.CMD >
  11. #include < sscanf2 >
  12. //-------------------------------- DAMAGE INFORMER ---------------------------//
  13. #include < weapon-config >
  14. #include < SKY >
  15. #if defined _ALS_OnPlayerGiveDamage
  16.     #undef OnPlayerGiveDamage
  17. #else
  18.     #define _ALS_OnPlayerGiveDamage
  19. #endif
  20. #define OnPlayerGiveDamage NULL_OnPlayerGiveDamage
  21. #if defined NULL_OnPlayerGiveDamage
  22.     forward NULL_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
  23. #endif
  24. #if defined _ALS_OnPlayerTakeDamage
  25.     #undef OnPlayerTakeDamage
  26. #else
  27.     #define _ALS_OnPlayerTakeDamage
  28. #endif
  29. #define OnPlayerTakeDamage NULL_OnPlayerTakeDamage
  30. #if defined NULL_OnPlayerTakeDamage
  31.     forward NULL_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
  32. #endif
  33. //---------------------------------- DEFINES ---------------------------------//
  34. #define MYSQL_HOST                                                   "127.0.0.1"
  35. #define MYSQL_USER                                                        "root"
  36. #define MYSQL_PASSWORD                                                        ""
  37. #define MYSQL_DATABASE                                                     "adm"
  38. //--------------------------------- DIALOGS ----------------------------------//
  39. enum
  40. {
  41.     DIALOG_REGISTER,
  42.     DIALOG_LOGIN,
  43.     DIALOG_NORESPONSE,
  44.     DIALOG_HELP,
  45.     DIALOG_DMARENE,
  46.     DIALOG_DUEL
  47. }
  48. //----------------------------------- ENUM -----------------------------------//
  49. enum PLAYER_INFO
  50. {
  51.     pID,
  52.     pName[25],
  53.     pPassword[65],
  54.     pSalt[11],
  55.     pPasswordFails,
  56.     pKills,
  57.     pDeaths,
  58.     pScore,
  59.     pCash,
  60.     pAdmin,
  61.     pSkin,
  62.     pBanned,
  63.     pBanReason[50],
  64.     Cache:Player_Cache
  65. }
  66. //---------------------------------- NEWS ------------------------------------//
  67. new PI[MAX_PLAYERS][PLAYER_INFO];
  68. new MySQL:Database, Corrupt_Check[MAX_PLAYERS];
  69. //----------------------------------------------------------------------------//
  70. new Text:InGameTD[9], PlayerText:KillsTD[MAX_PLAYERS], PlayerText:DeathsTD[MAX_PLAYERS],
  71.     PlayerText:RankTD[MAX_PLAYERS], PlayerText:NickTD[MAX_PLAYERS];
  72. //----------------------------------------------------------------------------//
  73. new bool:NexACDetect[MAX_PLAYERS], bool:UlogovanIgrac[MAX_PLAYERS], TextCD[MAX_PLAYERS],
  74.     UDMAreni[MAX_PLAYERS], CMDCD[MAX_PLAYERS], DuelIgrac[MAX_PLAYERS], ZahtevZaDuel[MAX_PLAYERS],
  75.     InDM1, InDM2, InDM3, InDM4, InDM5, IgracevRank[MAX_PLAYERS][30], DuelOpcije[MAX_PLAYERS][4],
  76.     Float:DuelHP[MAX_PLAYERS], Float:DuelArmour[MAX_PLAYERS], SekundeDuel[MAX_PLAYERS], TimerODuel[MAX_PLAYERS];
  77. //--------------------------- Random DM Arene Spawn --------------------------//
  78. new Float:LVPD[7][3]=
  79. {
  80.     {289.4713,168.9777,1007.1719},
  81.     {296.6701,187.1066,1007.1719},
  82.     {255.0509,189.9045,1008.1719},
  83.     {213.5514,141.5470,1003.0234},
  84.     {191.8244,158.4517,1003.0234},
  85.     {190.1116,179.0616,1003.0234},
  86.     {230.2902,179.1490,1003.0313}
  87. };
  88. new Float:GTOWN[6][3]=
  89. {
  90.     {-372.0640,2269.2002,42.1420},
  91.     {-350.4502,2241.4490,42.4844},
  92.     {-350.8359,2216.3533,42.4844},
  93.     {-361.0794,2203.4553,42.4844},
  94.     {-402.6833,2199.9370,42.4297},
  95.     {-443.3412,2220.3752,42.4297}
  96. };
  97. new Float:RCRAND[8][3]=
  98. {
  99.     {-974.9233,1089.6772,1344.9744},
  100.     {-974.8738,1060.5751,1345.6719},
  101.     {-1010.3456,1099.0929,1341.9373},
  102.     {-1067.5536,1094.2667,1343.1432},
  103.     {-1054.7448,1021.2515,1343.1893},
  104.     {-1102.0070,1019.5742,1342.0938},
  105.     {-1132.0172,1029.3613,1345.7325},
  106.     {-1130.7610,1057.9550,1346.4141}
  107. };
  108. new Float:JM[7][3]=
  109. {
  110.     {2224.3181,-1143.9808,1025.7969},
  111.     {2215.2036,-1150.2555,1025.7969},
  112.     {2220.6833,-1138.9036,1027.7969},
  113.     {2235.7795,-1193.9183,1029.8043},
  114.     {2240.5454,-1192.5084,1033.7969},
  115.     {2227.5332,-1183.2355,1029.8043},
  116.     {2188.3896,-1181.7401,1029.7969}
  117. };
  118. new Float:MF[7][3]=
  119. {
  120.     {963.418762,2108.292480,1011.030273},
  121.     {961.1073,2099.6902,1011.0250},
  122.     {948.4927,2105.8589,1011.0234},
  123.     {959.3273,2145.4019,1011.0289},
  124.     {934.0167,2144.2883,1011.0234},
  125.     {933.7863,2164.0837,1011.0303},
  126.     {954.0387,2176.6511,1011.0234}
  127. };
  128. //--------------------------------- MAIN -------------------------------------//
  129. main() { }
  130. //-------------------------------- PUBLIC ------------------------------------//
  131. public OnGameModeInit()
  132. {
  133.     new MySQLOpt: option_id = mysql_init_options();
  134.     mysql_set_option(option_id, AUTO_RECONNECT, true);
  135.     //------------------------------------------------------------------------//
  136.     Database = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, option_id);
  137.     //------------------------------------------------------------------------//
  138.     if(Database == MYSQL_INVALID_HANDLE || mysql_errno(Database) != 0)
  139.     {
  140.         print("I couldn't connect to the MySQL server, closing.");
  141.  
  142.         SendRconCommand("exit");
  143.         return 1;
  144.     }
  145.     //------------------------------------------------------------------------//
  146.     print("I have connected to the MySQL server.");
  147.     //------------------------------------------------------------------------//
  148.     InGameTD[0] = TextDrawCreate(557.357421, 395.333343, "LD_SPAC:white");
  149.     TextDrawLetterSize(InGameTD[0], 0.000000, 0.000000);
  150.     TextDrawTextSize(InGameTD[0], 83.000000, 71.000000);
  151.     TextDrawAlignment(InGameTD[0], 1);
  152.     TextDrawColor(InGameTD[0], 255);
  153.     TextDrawSetShadow(InGameTD[0], 0);
  154.     TextDrawSetOutline(InGameTD[0], 0);
  155.     TextDrawBackgroundColor(InGameTD[0], 255);
  156.     TextDrawFont(InGameTD[0], 4);
  157.     TextDrawSetProportional(InGameTD[0], 0);
  158.     TextDrawSetShadow(InGameTD[0], 0);
  159.  
  160.     InGameTD[1] = TextDrawCreate(559.231567, 397.666687, "LD_SPAC:white");
  161.     TextDrawLetterSize(InGameTD[1], 0.000000, 0.000000);
  162.     TextDrawTextSize(InGameTD[1], 83.000000, 71.000000);
  163.     TextDrawAlignment(InGameTD[1], 1);
  164.     TextDrawColor(InGameTD[1], 303174399);
  165.     TextDrawSetShadow(InGameTD[1], 0);
  166.     TextDrawSetOutline(InGameTD[1], 0);
  167.     TextDrawBackgroundColor(InGameTD[1], 255);
  168.     TextDrawFont(InGameTD[1], 4);
  169.     TextDrawSetProportional(InGameTD[1], 0);
  170.     TextDrawSetShadow(InGameTD[1], 0);
  171.  
  172.     InGameTD[2] = TextDrawCreate(561.574157, 402.333343, "LD_SPAC:white");
  173.     TextDrawLetterSize(InGameTD[2], 0.000000, 0.000000);
  174.     TextDrawTextSize(InGameTD[2], 76.000000, 10.000000);
  175.     TextDrawAlignment(InGameTD[2], 1);
  176.     TextDrawColor(InGameTD[2], 255);
  177.     TextDrawSetShadow(InGameTD[2], 0);
  178.     TextDrawSetOutline(InGameTD[2], 0);
  179.     TextDrawBackgroundColor(InGameTD[2], 255);
  180.     TextDrawFont(InGameTD[2], 4);
  181.     TextDrawSetProportional(InGameTD[2], 0);
  182.     TextDrawSetShadow(InGameTD[2], 0);
  183.  
  184.     InGameTD[3] = TextDrawCreate(561.574218, 415.166748, "LD_SPAC:white");
  185.     TextDrawLetterSize(InGameTD[3], 0.000000, 0.000000);
  186.     TextDrawTextSize(InGameTD[3], 76.000000, 10.000000);
  187.     TextDrawAlignment(InGameTD[3], 1);
  188.     TextDrawColor(InGameTD[3], 255);
  189.     TextDrawSetShadow(InGameTD[3], 0);
  190.     TextDrawSetOutline(InGameTD[3], 0);
  191.     TextDrawBackgroundColor(InGameTD[3], 255);
  192.     TextDrawFont(InGameTD[3], 4);
  193.     TextDrawSetProportional(InGameTD[3], 0);
  194.     TextDrawSetShadow(InGameTD[3], 0);
  195.  
  196.     InGameTD[4] = TextDrawCreate(561.574218, 427.416778, "LD_SPAC:white");
  197.     TextDrawLetterSize(InGameTD[4], 0.000000, 0.000000);
  198.     TextDrawTextSize(InGameTD[4], 76.000000, 10.000000);
  199.     TextDrawAlignment(InGameTD[4], 1);
  200.     TextDrawColor(InGameTD[4], 255);
  201.     TextDrawSetShadow(InGameTD[4], 0);
  202.     TextDrawSetOutline(InGameTD[4], 0);
  203.     TextDrawBackgroundColor(InGameTD[4], 255);
  204.     TextDrawFont(InGameTD[4], 4);
  205.     TextDrawSetProportional(InGameTD[4], 0);
  206.     TextDrawSetShadow(InGameTD[4], 0);
  207.  
  208.     InGameTD[5] = TextDrawCreate(557.357543, 440.250091, "LD_SPAC:white");
  209.     TextDrawLetterSize(InGameTD[5], 0.000000, 0.000000);
  210.     TextDrawTextSize(InGameTD[5], 131.000000, 10.000000);
  211.     TextDrawAlignment(InGameTD[5], 1);
  212.     TextDrawColor(InGameTD[5], 255);
  213.     TextDrawSetShadow(InGameTD[5], 0);
  214.     TextDrawSetOutline(InGameTD[5], 0);
  215.     TextDrawBackgroundColor(InGameTD[5], 255);
  216.     TextDrawFont(InGameTD[5], 4);
  217.     TextDrawSetProportional(InGameTD[5], 0);
  218.     TextDrawSetShadow(InGameTD[5], 0);
  219.  
  220.     InGameTD[6] = TextDrawCreate(564.085144, 402.916564, "Kills:");
  221.     TextDrawLetterSize(InGameTD[6], 0.252415, 0.765833);
  222.     TextDrawAlignment(InGameTD[6], 1);
  223.     TextDrawColor(InGameTD[6], -1);
  224.     TextDrawSetShadow(InGameTD[6], 0);
  225.     TextDrawSetOutline(InGameTD[6], 0);
  226.     TextDrawBackgroundColor(InGameTD[6], 255);
  227.     TextDrawFont(InGameTD[6], 1);
  228.     TextDrawSetProportional(InGameTD[6], 1);
  229.     TextDrawSetShadow(InGameTD[6], 0);
  230.  
  231.     InGameTD[7] = TextDrawCreate(564.085083, 416.333251, "Deaths:");
  232.     TextDrawLetterSize(InGameTD[7], 0.252415, 0.765833);
  233.     TextDrawAlignment(InGameTD[7], 1);
  234.     TextDrawColor(InGameTD[7], -1);
  235.     TextDrawSetShadow(InGameTD[7], 0);
  236.     TextDrawSetOutline(InGameTD[7], 0);
  237.     TextDrawBackgroundColor(InGameTD[7], 255);
  238.     TextDrawFont(InGameTD[7], 1);
  239.     TextDrawSetProportional(InGameTD[7], 1);
  240.     TextDrawSetShadow(InGameTD[7], 0);
  241.  
  242.     InGameTD[8] = TextDrawCreate(564.553588, 428.583312, "Rank:");
  243.     TextDrawLetterSize(InGameTD[8], 0.252415, 0.765833);
  244.     TextDrawAlignment(InGameTD[8], 1);
  245.     TextDrawColor(InGameTD[8], -1);
  246.     TextDrawSetShadow(InGameTD[8], 0);
  247.     TextDrawSetOutline(InGameTD[8], 0);
  248.     TextDrawBackgroundColor(InGameTD[8], 255);
  249.     TextDrawFont(InGameTD[8], 1);
  250.     TextDrawSetProportional(InGameTD[8], 1);
  251.     TextDrawSetShadow(InGameTD[8], 0);
  252.     //------------------------------------------------------------------------//
  253.     SetGameModeText("- A DeathMatch v1.0 -");
  254.     DisableInteriorEnterExits();
  255.     //------------------------------------------------------------------------//
  256.     mysql_tquery(Database, "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT,`USERNAME` varchar(24) NOT NULL,`PASSWORD` char(65) NOT NULL,`SALT` char(11) NOT NULL,`RANK` varchar(30) NOT NULL, `SCORE` mediumint(7), `SKIN` int(3), `ADMIN` mediumint(7), `CASH` mediumint(7) NOT NULL DEFAULT '0', `KILLS` mediumint(7),`DEATHS` mediumint(7) NOT NULL DEFAULT '0', `BANNED` mediumint(7), `BANREASON` varchar(50) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `USERNAME` (`USERNAME`))");
  257.     //------------------------------------------------------------------------//
  258.     return 1;
  259. }
  260. //----------------------------------------------------------------------------//
  261. public OnGameModeExit()
  262. {
  263.     foreach(new i: Player)
  264.     {
  265.         if(IsPlayerConnected(i))
  266.         {
  267.             OnPlayerDisconnect(i, 1);
  268.         }
  269.     }
  270.     //------------------------------------------------------------------------//
  271.     mysql_close(Database);
  272.     return 1;
  273. }
  274. //----------------------------------------------------------------------------//
  275. public OnPlayerText(playerid, text[])
  276. {
  277.     if(!UlogovanIgrac[playerid]) return SendClientMessage(playerid, 0x0077C7FF, "[A-AC] {FFFFFF}Morate biti ulogovani da biste pisali.");
  278.     new chatcd = gettime();
  279.     if(chatcd < (TextCD[playerid] + 3) && PI[playerid][pAdmin] < 1)
  280.     {
  281.          SendClientMessage(playerid, 0x0077C7FF, "[A-AC] {FFFFFF}Mozete pisati svakih 3 sekunde.");
  282.          return 0;
  283.     }
  284.     TextCD[playerid] = gettime();
  285.     new str[200];
  286.     if(PI[playerid][pAdmin] < 1) format(str, sizeof(str), "[%s] {FFFFFF}%s: %s.", IgracevRank[playerid], ImeIgraca(playerid), text);
  287.     else format(str, sizeof(str), "[Admin %d] {FFFFFF}%s: %s.", PI[playerid][pAdmin], ImeIgraca(playerid), text);
  288.     SendClientMessageToAll(0x0077C7FF, str);
  289.     return 0;
  290. }
  291. //----------------------------------------------------------------------------//
  292. public OnPlayerConnect(playerid)
  293. {
  294.     new DB_Query[115];
  295.     //------------------------------------------------------------------------//
  296.     PI[playerid][pKills] = 0;
  297.     PI[playerid][pDeaths] = 0;
  298.     PI[playerid][pPasswordFails] = 0;
  299.     NexACDetect[playerid] = false;
  300.     UDMAreni[playerid] = 0;
  301.     DuelIgrac[playerid] = -1;
  302.     ZahtevZaDuel[playerid] = -1;
  303.     //------------------------------------------------------------------------//
  304.     KillsTD[playerid] = CreatePlayerTextDraw(playerid, 583.763183, 403.499816, "1000");
  305.     PlayerTextDrawLetterSize(playerid, KillsTD[playerid], 0.252415, 0.765833);
  306.     PlayerTextDrawAlignment(playerid, KillsTD[playerid], 1);
  307.     PlayerTextDrawColor(playerid, KillsTD[playerid], 7849983);
  308.     PlayerTextDrawSetShadow(playerid, KillsTD[playerid], 0);
  309.     PlayerTextDrawSetOutline(playerid, KillsTD[playerid], 0);
  310.     PlayerTextDrawBackgroundColor(playerid, KillsTD[playerid], 255);
  311.     PlayerTextDrawFont(playerid, KillsTD[playerid], 1);
  312.     PlayerTextDrawSetProportional(playerid, KillsTD[playerid], 1);
  313.     PlayerTextDrawSetShadow(playerid, KillsTD[playerid], 0);
  314.     //------------------------------------------------------------------------//
  315.     DeathsTD[playerid] = CreatePlayerTextDraw(playerid, 595.007629, 416.333129, "1000");
  316.     PlayerTextDrawLetterSize(playerid, DeathsTD[playerid], 0.252415, 0.765833);
  317.     PlayerTextDrawAlignment(playerid, DeathsTD[playerid], 1);
  318.     PlayerTextDrawColor(playerid, DeathsTD[playerid], 7849983);
  319.     PlayerTextDrawSetShadow(playerid, DeathsTD[playerid], 0);
  320.     PlayerTextDrawSetOutline(playerid, DeathsTD[playerid], 0);
  321.     PlayerTextDrawBackgroundColor(playerid, DeathsTD[playerid], 255);
  322.     PlayerTextDrawFont(playerid, DeathsTD[playerid], 1);
  323.     PlayerTextDrawSetProportional(playerid, DeathsTD[playerid], 1);
  324.     PlayerTextDrawSetShadow(playerid, DeathsTD[playerid], 0);
  325.     //------------------------------------------------------------------------//
  326.     RankTD[playerid] = CreatePlayerTextDraw(playerid, 587.979858, 428.583221, "Transformer");
  327.     PlayerTextDrawLetterSize(playerid, RankTD[playerid], 0.242108, 0.742500);
  328.     PlayerTextDrawAlignment(playerid, RankTD[playerid], 1);
  329.     PlayerTextDrawColor(playerid, RankTD[playerid], 7849983);
  330.     PlayerTextDrawSetShadow(playerid, RankTD[playerid], 0);
  331.     PlayerTextDrawSetOutline(playerid, RankTD[playerid], 0);
  332.     PlayerTextDrawBackgroundColor(playerid, RankTD[playerid], 255);
  333.     PlayerTextDrawFont(playerid, RankTD[playerid], 1);
  334.     PlayerTextDrawSetProportional(playerid, RankTD[playerid], 1);
  335.     PlayerTextDrawSetShadow(playerid, RankTD[playerid], 0);
  336.     //------------------------------------------------------------------------//
  337.     NickTD[playerid] = CreatePlayerTextDraw(playerid, 599.224670, 440.833221, "Atrox_DM");
  338.     PlayerTextDrawLetterSize(playerid, NickTD[playerid], 0.203689, 0.567500);
  339.     PlayerTextDrawAlignment(playerid, NickTD[playerid], 2);
  340.     PlayerTextDrawColor(playerid, NickTD[playerid], 7849983);
  341.     PlayerTextDrawSetShadow(playerid, NickTD[playerid], 0);
  342.     PlayerTextDrawSetOutline(playerid, NickTD[playerid], 0);
  343.     PlayerTextDrawBackgroundColor(playerid, NickTD[playerid], 255);
  344.     PlayerTextDrawFont(playerid, NickTD[playerid], 1);
  345.     PlayerTextDrawSetProportional(playerid, NickTD[playerid], 1);
  346.     PlayerTextDrawSetShadow(playerid, NickTD[playerid], 0);
  347.     //------------------------------------------------------------------------//
  348.     GetPlayerName(playerid, PI[playerid][pName], MAX_PLAYER_NAME);
  349.     Corrupt_Check[playerid]++;
  350.     //------------------------------------------------------------------------//
  351.     mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1", PI[playerid][pName]);
  352.     mysql_tquery(Database, DB_Query, "OnPlayerDataCheck", "ii", playerid, Corrupt_Check[playerid]);
  353.     return 1;
  354. }
  355. //----------------------------------------------------------------------------//
  356. public OnPlayerDisconnect(playerid, reason)
  357. {
  358.     Corrupt_Check[playerid]++;
  359.     //------------------------------------------------------------------------//
  360.     new DB_Query[256];
  361.     mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `CASH` = %d, `SKIN` = %d, `KILLS` = %d, `DEATHS` = %d WHERE `ID` = %d LIMIT 1",
  362.     PI[playerid][pScore], PI[playerid][pCash], PI[playerid][pKills], PI[playerid][pDeaths], PI[playerid][pSkin], PI[playerid][pID]);
  363.     PI[playerid][pSkin] = GetPlayerSkin(playerid);
  364.     //------------------------------------------------------------------------//
  365.     mysql_tquery(Database, DB_Query);
  366.     //------------------------------------------------------------------------//
  367.     if(cache_is_valid(PI[playerid][Player_Cache]))
  368.     {
  369.         cache_delete(PI[playerid][Player_Cache]);
  370.         PI[playerid][Player_Cache] = MYSQL_INVALID_CACHE;
  371.     }
  372.     //------------------------------------------------------------------------//
  373.     UlogovanIgrac[playerid] = false;
  374.     return 1;
  375. }
  376. //----------------------------------------------------------------------------//
  377. public OnPlayerDeath(playerid, killerid, reason)
  378. {
  379.     SendDeathMessage(killerid, playerid, reason);
  380.     //------------------------------------------------------------------------//
  381.     if(UDMAreni[playerid] > 0)
  382.     {
  383.         switch(UDMAreni[playerid])
  384.         {
  385.             case 1:
  386.             {
  387.                 new rand = random(sizeof(LVPD));
  388.                 SetPlayerVirtualWorld(playerid, 1001);
  389.                 SetPlayerInterior(playerid, 3);
  390.                 SetSpawnInfo(playerid, 0, PI[playerid][pSkin], LVPD[rand][0], LVPD[rand][1], LVPD[rand][2], 0.0, 24, 200, 0, 0, 0, 0);
  391.                 SpawnPlayer(playerid);
  392.                 SetPlayerHealth(playerid, 99.0);
  393.                 SetPlayerArmour(playerid, 99.0);
  394.                 UDMAreni[playerid] = 1;
  395.             }
  396.             case 2:
  397.             {
  398.                 new rand = random(sizeof(GTOWN));
  399.                 SetPlayerVirtualWorld(playerid, 1001);
  400.                 SetPlayerInterior(playerid, 3);
  401.                 SetSpawnInfo(playerid, 0, PI[playerid][pSkin], GTOWN[rand][0], GTOWN[rand][1], GTOWN[rand][2], 0.0, 24, 200, 0, 0, 0, 0);
  402.                 SpawnPlayer(playerid);
  403.                 SetPlayerHealth(playerid, 99.0);
  404.                 SetPlayerArmour(playerid, 99.0);
  405.                 UDMAreni[playerid] = 2;
  406.             }
  407.             case 3:
  408.             {
  409.                 new rand = random(sizeof(RCRAND));
  410.                 SetPlayerVirtualWorld(playerid, 1001);
  411.                 SetPlayerInterior(playerid, 3);
  412.                 SetSpawnInfo(playerid, 0, PI[playerid][pSkin], RCRAND[rand][0], RCRAND[rand][1], RCRAND[rand][2], 0.0, 24, 200, 0, 0, 0, 0);
  413.                 SpawnPlayer(playerid);
  414.                 SetPlayerHealth(playerid, 99.0);
  415.                 SetPlayerArmour(playerid, 99.0);
  416.                 UDMAreni[playerid] = 3;
  417.             }
  418.             case 4:
  419.             {
  420.                 new rand = random(sizeof(JM));
  421.                 SetPlayerVirtualWorld(playerid, 1001);
  422.                 SetPlayerInterior(playerid, 3);
  423.                 SetSpawnInfo(playerid, 0, PI[playerid][pSkin], JM[rand][0], JM[rand][1], JM[rand][2], 0.0, 24, 200, 0, 0, 0, 0);
  424.                 SpawnPlayer(playerid);
  425.                 SetPlayerHealth(playerid, 99.0);
  426.                 SetPlayerArmour(playerid, 99.0);
  427.                 UDMAreni[playerid] = 4;
  428.             }
  429.             case 5:
  430.             {
  431.                 new rand = random(sizeof(MF));
  432.                 SetPlayerVirtualWorld(playerid, 1001);
  433.                 SetPlayerInterior(playerid, 3);
  434.                 SetSpawnInfo(playerid, 0, PI[playerid][pSkin], MF[rand][0], MF[rand][1], MF[rand][2], 0.0, 24, 200, 0, 0, 0, 0);
  435.                 SpawnPlayer(playerid);
  436.                 SetPlayerHealth(playerid, 99.0);
  437.                 SetPlayerArmour(playerid, 99.0);
  438.                 UDMAreni[playerid] = 5;
  439.             }
  440.         }
  441.     }
  442.     if(DuelIgrac[playerid] != -1)
  443.     {
  444.         new i = DuelIgrac[playerid], str[100];
  445.         ResetPlayerWeapons(i);
  446.         SetPlayerPos(i, 1958.33, 1343.12, 15.36);
  447.         SetPlayerVirtualWorld(i, 0);
  448.         SetPlayerInterior(i, 0);
  449.         format(str, sizeof(str), "[DUEL] {FFFFFF}Igrac %s je pobedio %s u duelu.", ImeIgraca(i), ImeIgraca(playerid));
  450.         SendClientMessageToAll(0x0077C7FF, str);
  451.         SetSpawnInfo(playerid, 0, PI[playerid][pSkin], 1958.33, 1343.12, 15.36, 0.0, 24, 200, 0, 0, 0, 0);
  452.         SpawnPlayer(playerid);
  453.         DuelIgrac[i] = -1;
  454.         DuelIgrac[playerid] = -1;
  455.     }
  456.     if(killerid != INVALID_PLAYER_ID)
  457.     {  
  458.         PI[killerid][pKills]++;
  459.         PI[playerid][pDeaths]++;
  460.         new str1[30];
  461.         format(str1, sizeof(str1), "%d", PI[killerid][pKills]);
  462.         PlayerTextDrawSetString(killerid, KillsTD[killerid], str1);
  463.         format(str1, sizeof(str1), "%d", PI[playerid][pDeaths]);
  464.         PlayerTextDrawSetString(playerid, DeathsTD[playerid], str1);
  465.         switch(PI[killerid][pKills])
  466.         {
  467.             case 20:
  468.             {
  469.                 new DB_Query[250], str[30];
  470.                 IgracevRank[killerid] = "Pee-Wee";
  471.                 SendClientMessage(killerid, 0x0077C7FF, "[A-DM] {FFFFFF}Cestitamo, unapredjeni ste u rank 'Pee-Wee' !");
  472.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `RANK` = '%s' WHERE `ID` = %d LIMIT 1",
  473.                 IgracevRank[killerid], PI[killerid][pID]);
  474.                 mysql_tquery(Database, DB_Query);
  475.                 format(str, sizeof(str), "%s", IgracevRank[killerid]);
  476.                 PlayerTextDrawSetString(playerid, RankTD[killerid], str);
  477.             }
  478.             case 40:
  479.             {
  480.                 new DB_Query[250], str[30];
  481.                 IgracevRank[killerid] = "Transformer";
  482.                 SendClientMessage(killerid, 0x0077C7FF, "[A-DM] {FFFFFF}Cestitamo, unapredjeni ste u rank 'Transformer' !");
  483.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `RANK` = '%s' WHERE `ID` = %d LIMIT 1",
  484.                 IgracevRank[killerid], PI[killerid][pID]);
  485.                 mysql_tquery(Database, DB_Query);
  486.                 format(str, sizeof(str), "%s", IgracevRank[killerid]);
  487.                 PlayerTextDrawSetString(playerid, RankTD[killerid], str);
  488.             }
  489.             case 60:
  490.             {
  491.                 new DB_Query[250], str[30];
  492.                 IgracevRank[killerid] = "HomeBoy";
  493.                 SendClientMessage(killerid, 0x0077C7FF, "[A-DM] {FFFFFF}Cestitamo, unapredjeni ste u rank 'HomeBoy' !");
  494.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `RANK` = '%s' WHERE `ID` = %d LIMIT 1",
  495.                 IgracevRank[killerid], PI[killerid][pID]);
  496.                 mysql_tquery(Database, DB_Query);
  497.                 format(str, sizeof(str), "%s", IgracevRank[killerid]);
  498.                 PlayerTextDrawSetString(playerid, RankTD[killerid], str);
  499.             }
  500.             case 80:
  501.             {
  502.                 new DB_Query[250], str[30];
  503.                 IgracevRank[killerid] = "Soldier";
  504.                 SendClientMessage(killerid, 0x0077C7FF, "[A-DM] {FFFFFF}Cestitamo, unapredjeni ste u rank 'Soldier' !");
  505.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `RANK` = '%s' WHERE `ID` = %d LIMIT 1",
  506.                 IgracevRank[killerid], PI[killerid][pID]);
  507.                 mysql_tquery(Database, DB_Query);
  508.                 format(str, sizeof(str), "%s", IgracevRank[killerid]);
  509.                 PlayerTextDrawSetString(playerid, RankTD[killerid], str);
  510.             }
  511.             case 100:
  512.             {
  513.                 new DB_Query[250], str[30];
  514.                 IgracevRank[killerid] = "High Roller";
  515.                 SendClientMessage(killerid, 0x0077C7FF, "[A-DM] {FFFFFF}Cestitamo, unapredjeni ste u rank 'High Roller' !");
  516.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `RANK` = '%s' WHERE `ID` = %d LIMIT 1",
  517.                 IgracevRank[killerid], PI[killerid][pID]);
  518.                 mysql_tquery(Database, DB_Query);
  519.                 format(str, sizeof(str), "%s", IgracevRank[killerid]);
  520.                 PlayerTextDrawSetString(playerid, RankTD[killerid], str);
  521.             }
  522.             case 120:
  523.             {
  524.                 new DB_Query[250], str[150];
  525.                 IgracevRank[killerid] = "GodFather";
  526.                 SendClientMessage(killerid, 0x0077C7FF, "[A-DM] {FFFFFF}Cestitamo, unapredjeni ste u rank 'GodFather' !");
  527.                 format(str, sizeof(str), "[ADM-INFO] {FFFFFF}Cestitamo ! Igrac %s je dostigao najveci rank - GodFather !", ImeIgraca(killerid));
  528.                 SendClientMessageToAll(0x0077C7FF, str);
  529.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `RANK` = '%s' WHERE `ID` = %d LIMIT 1",
  530.                 IgracevRank[killerid], PI[killerid][pID]);
  531.                 mysql_tquery(Database, DB_Query);
  532.                 format(str, sizeof(str), "%s", IgracevRank[killerid]);
  533.                 PlayerTextDrawSetString(playerid, RankTD[killerid], str);
  534.             }
  535.         }
  536.     }
  537.     return 1;
  538. }
  539. //----------------------------------------------------------------------------//
  540. public OnPlayerRequestSpawn(playerid)
  541. {
  542.     if(!UlogovanIgrac[playerid]) return 0;
  543.     return 1;
  544. }
  545. //----------------------------------------------------------------------------//
  546. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  547. {
  548.     switch (dialogid)
  549.     {
  550.         case DIALOG_LOGIN:
  551.         {
  552.             if(!response) return Kick(playerid);
  553.             //----------------------------------------------------------------//
  554.             new Salted_Key[65];
  555.             SHA256_PassHash(inputtext, PI[playerid][pSalt], Salted_Key, 65);
  556.             //----------------------------------------------------------------//
  557.             if(strcmp(Salted_Key, PI[playerid][pPassword]) == 0)
  558.             {
  559.                 cache_set_active(PI[playerid][Player_Cache]);
  560.                 //------------------------------------------------------------//
  561.                 cache_get_value_int(0, "ID", PI[playerid][pID]);
  562.                 cache_get_value_name(0, "RANK", IgracevRank[playerid], 30);
  563.                 cache_get_value_int(0, "ADMIN", PI[playerid][pAdmin]);
  564.                 cache_get_value_int(0, "KILLS", PI[playerid][pKills]);
  565.                 cache_get_value_int(0, "DEATHS", PI[playerid][pDeaths]);
  566.                 cache_get_value_int(0, "SKIN", PI[playerid][pSkin]);
  567.                 cache_get_value_int(0, "SCORE", PI[playerid][pScore]);
  568.                 cache_get_value_int(0, "CASH", PI[playerid][pCash]);
  569.                 //------------------------------------------------------------//
  570.                 SetPlayerScore(playerid, PI[playerid][pScore]);
  571.                 //------------------------------------------------------------//
  572.                 SetPlayerSkin(playerid, PI[playerid][pSkin]);
  573.                 //------------------------------------------------------------//
  574.                 ResetPlayerMoney(playerid);
  575.                 GivePlayerMoney(playerid, PI[playerid][pCash]);
  576.                 //------------------------------------------------------------//
  577.                 cache_delete(PI[playerid][Player_Cache]);
  578.                 PI[playerid][Player_Cache] = MYSQL_INVALID_CACHE;
  579.                 //------------------------------------------------------------//
  580.                 SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Uspesno ste se prijavili.");
  581.                 SetSpawnInfo(playerid, 0, PI[playerid][pSkin], 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  582.                 SpawnPlayer(playerid);
  583.             }
  584.             else
  585.             {
  586.                 new String[150];
  587.                 //------------------------------------------------------------//
  588.                 PI[playerid][pPasswordFails] += 1;
  589.                 //------------------------------------------------------------//
  590.                 if (PI[playerid][pPasswordFails] >= 3)
  591.                 {
  592.                     format(String, sizeof(String), "[A-AC] {FFFFFF}%s je izbacen sa servera. Razlog: {0077C7}(3/3) Login greski.", PI[playerid][pName]);
  593.                     SendAdminMessage(0x0077C7FF, String);
  594.                     Kick(playerid);
  595.                 }
  596.                 else
  597.                 {
  598.                     format(String, sizeof(String), "Pogresna sifra, imas jos %d pokusaja.", 3-PI[playerid][pPasswordFails]);
  599.                     SendClientMessage(playerid, 0xFF0000FF, String);
  600.                    
  601.                     format(String, sizeof(String), "{FFFFFF}Dobrodosao nazad, {0077C7}%s.\n\n{FFFFFF}Upisite lozinku kako biste nastavili sa igrom.", PI[playerid][pName]);
  602.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{0077C7}ATROX {0077C7}D{FFFFFF}M", String, "Login", "Izlaz");
  603.                 }
  604.             }
  605.         }
  606.         case DIALOG_REGISTER:
  607.         {
  608.             if(!response) return Kick(playerid);
  609.  
  610.             if(strlen(inputtext) <= 5 || strlen(inputtext) > 60)
  611.             {
  612.                 SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Lozinka mora sadrzati najmanje 5 slova, a najvise 60.");
  613.                 //------------------------------------------------------------//
  614.                 new String[150];
  615.                 //------------------------------------------------------------//
  616.                 format(String, sizeof(String), "{FFFFFF}Dobrodosao {0077C7}%s.\n\n{FFFFFF}Upisite zeljenu lozinku kako biste napravili nalog.\n\n", PI[playerid][pName]);
  617.                 ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{0077C7}ATROX {0077C7}D{FFFFFF}M", String, "Register", "Izlaz");
  618.             }
  619.             else
  620.             {
  621.                 for (new i = 0; i < 10; i++)
  622.                 {
  623.                     PI[playerid][pSalt][i] = random(79) + 47;
  624.                 }
  625.                 //------------------------------------------------------------//
  626.                 PI[playerid][pSalt][10] = 0;
  627.                 SHA256_PassHash(inputtext, PI[playerid][pSalt], PI[playerid][pPassword], 65);
  628.                 //------------------------------------------------------------//
  629.                 new DB_Query[350], str[13];
  630.                 format(str, sizeof(str), "NIJE BANOVAN");
  631.                 IgracevRank[playerid] = "Newbie";
  632.                 PI[playerid][pSkin] = 1;
  633.                 //------------------------------------------------------------//
  634.                 mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `PLAYERS` (`USERNAME`, `PASSWORD`, `RANK`, `ADMIN`, `SALT`, `SCORE`, `KILLS`, `CASH`, `DEATHS`, `BANNED`, `BANREASON`,  `SKIN`)\
  635.                 VALUES ('%e', '%s', '%e', '0', '%e', '0', '0', '0', '0', '0', '%s', '%e')", PI[playerid][pName], PI[playerid][pPassword], IgracevRank[playerid], PI[playerid][pSalt], str, PI[playerid][pSkin]);
  636.                 mysql_tquery(Database, DB_Query, "OnPlayerRegister", "d", playerid);
  637.              }
  638.         }
  639.         case DIALOG_DMARENE:
  640.         {
  641.             if(!response) return 1;
  642.             switch(listitem)
  643.             {
  644.                 case 0:
  645.                 {
  646.                     if(InDM1 == 10) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Ta arena je puna (10/10).");
  647.                     new rand = random(sizeof(LVPD));
  648.                     SetPlayerVirtualWorld(playerid, 1001);
  649.                     SetPlayerInterior(playerid, 3);
  650.                     SetPlayerPos(playerid, LVPD[rand][0], LVPD[rand][1], LVPD[rand][2]);
  651.                     GivePlayerWeapon(playerid, 24, 200);
  652.                     SetPlayerHealth(playerid, 99.0);
  653.                     SetPlayerArmour(playerid, 99.0);
  654.                     UDMAreni[playerid] = 1;
  655.                     SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Usao si u DM Arenu 1 (LVPD).");
  656.                     InDM1 += 1;
  657.                    
  658.                 }
  659.                 case 1:
  660.                 {
  661.                     if(InDM2 == 10) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Ta arena je puna (10/10).");
  662.                     new rand = random(sizeof(GTOWN));
  663.                     SetPlayerVirtualWorld(playerid, 1002);
  664.                     SetPlayerInterior(playerid, 0);
  665.                     SetPlayerPos(playerid, GTOWN[rand][0], GTOWN[rand][1], GTOWN[rand][2]);
  666.                     GivePlayerWeapon(playerid, 24, 200);
  667.                     GivePlayerWeapon(playerid, 25, 150);
  668.                     GivePlayerWeapon(playerid, 33,50);
  669.                     SetPlayerHealth(playerid, 99.0);
  670.                     SetPlayerArmour(playerid, 99.0);
  671.                     UDMAreni[playerid] = 2;
  672.                     SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Usao si u DM Arenu 2 (Ghost Town).");
  673.                     InDM2 += 1;
  674.                 }
  675.                 case 2:
  676.                 {
  677.                     if(InDM3 == 10) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Ta arena je puna (10/10).");
  678.                     new rand = random(sizeof(RCRAND));
  679.                     SetPlayerVirtualWorld(playerid, 1003);
  680.                     SetPlayerInterior(playerid, 10);
  681.                     SetPlayerPos(playerid, RCRAND[rand][0], RCRAND[rand][1], RCRAND[rand][2]);
  682.                     GivePlayerWeapon(playerid, 24, 200);
  683.                     GivePlayerWeapon(playerid, 25, 150);
  684.                     GivePlayerWeapon(playerid, 31, 300);
  685.                     GivePlayerWeapon(playerid, 34,50);
  686.                     SetPlayerHealth(playerid, 99.0);
  687.                     SetPlayerArmour(playerid, 99.0);
  688.                     UDMAreni[playerid] = 3;
  689.                     SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Usao si u DM Arenu 3 (RC Battlefield).");
  690.                     InDM3 += 1;
  691.                 }
  692.                 case 3:
  693.                 {
  694.                     if(InDM4 == 10) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Ta arena je puna (10/10).");
  695.                     new rand = random(sizeof(JM));
  696.                     SetPlayerVirtualWorld(playerid, 1004);
  697.                     SetPlayerInterior(playerid, 15);
  698.                     SetPlayerPos(playerid, JM[rand][0], JM[rand][1], JM[rand][2]);
  699.                     GivePlayerWeapon(playerid, 24, 200);
  700.                     GivePlayerWeapon(playerid, 25, 150);
  701.                     SetPlayerHealth(playerid, 99.0);
  702.                     SetPlayerArmour(playerid, 99.0);
  703.                     UDMAreni[playerid] = 4;
  704.                     SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Usao si u DM Arenu 4 (Jefferson Motel).");
  705.                     InDM4 += 1;
  706.                 }
  707.                 case 4:
  708.                 {
  709.                     if(InDM5 == 10) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Ta arena je puna (10/10).");
  710.                     new rand = random(sizeof(MF));
  711.                     SetPlayerVirtualWorld(playerid, 1005);
  712.                     SetPlayerInterior(playerid, 1);
  713.                     SetPlayerPos(playerid, MF[rand][0], MF[rand][1], MF[rand][2]);
  714.                     GivePlayerWeapon(playerid, 24, 200);
  715.                     GivePlayerWeapon(playerid, 25, 150);
  716.                     SetPlayerHealth(playerid, 99.0);
  717.                     SetPlayerArmour(playerid, 99.0);
  718.                     UDMAreni[playerid] = 5;
  719.                     SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Usao si u DM Arenu 5 (Meat Factory).");
  720.                     InDM5 += 1;
  721.                 }
  722.             }
  723.         }
  724.         case DIALOG_DUEL:
  725.         {
  726.             if(response)
  727.             {
  728.                 SetPlayerPos(playerid, 1560.6750,-1347.2893,329.4609);
  729.                 SetPlayerPos(ZahtevZaDuel[playerid], 1526.8954,-1358.4513,329.4609);
  730.                 DuelIgrac[playerid] = ZahtevZaDuel[playerid];
  731.                 DuelIgrac[ZahtevZaDuel[playerid]] = playerid;
  732.                 ZahtevZaDuel[playerid] = -1;
  733.                 ZahtevZaDuel[DuelIgrac[playerid]] = -1;
  734.                 GivePlayerWeapon(playerid, DuelOpcije[DuelIgrac[playerid]][0], DuelOpcije[DuelIgrac[playerid]][2]);
  735.                 GivePlayerWeapon(DuelIgrac[playerid], DuelOpcije[DuelIgrac[playerid]][0], DuelOpcije[DuelIgrac[playerid]][2]);
  736.                 GivePlayerWeapon(playerid, DuelOpcije[DuelIgrac[playerid]][1], DuelOpcije[DuelIgrac[playerid]][3]);
  737.                 GivePlayerWeapon(DuelIgrac[playerid], DuelOpcije[DuelIgrac[playerid]][1], DuelOpcije[DuelIgrac[playerid]][3]);
  738.                 SetPlayerHealth(playerid, DuelHP[DuelIgrac[playerid]]);
  739.                 SetPlayerArmour(playerid, DuelArmour[DuelIgrac[playerid]]);
  740.                 SetPlayerHealth(DuelIgrac[playerid], DuelHP[DuelIgrac[playerid]]);
  741.                 SetPlayerArmour(DuelIgrac[playerid], DuelArmour[DuelIgrac[playerid]]);
  742.                 SetPlayerVirtualWorld(playerid, 1006);
  743.                 SetPlayerVirtualWorld(DuelIgrac[playerid], 1006);
  744.                 SetPlayerInterior(playerid, 0);
  745.                 SetPlayerInterior(DuelIgrac[playerid], 0);
  746.                 UDMAreni[playerid] = 0;
  747.                 SekundeDuel[playerid] = 3;
  748.                 TimerODuel[playerid] = SetTimerEx("DuelOTimer", 1000, true, "uu", playerid, DuelIgrac[playerid]);
  749.                 GameTextForPlayer(playerid, "~r~3", 1000, 3);
  750.                 GameTextForPlayer(DuelIgrac[playerid], "~r~3", 1000, 3);
  751.                 TogglePlayerControllable(playerid, 0);
  752.                 TogglePlayerControllable(DuelIgrac[playerid], 0);
  753.             }
  754.             else
  755.             {
  756.                 SendClientMessage(ZahtevZaDuel[playerid], 0x0077C7FF, "Igrac je odbio Vas zahtev za duel.");
  757.                 DuelOpcije[ZahtevZaDuel[playerid]][0] = 0; DuelOpcije[ZahtevZaDuel[playerid]][1] = 0;
  758.                 DuelOpcije[ZahtevZaDuel[playerid]][2] = 0; DuelOpcije[ZahtevZaDuel[playerid]][3] = 0;
  759.                 DuelHP[ZahtevZaDuel[playerid]] = 0; DuelArmour[ZahtevZaDuel[playerid]] = 0;
  760.                 ZahtevZaDuel[ZahtevZaDuel[playerid]] = -1;
  761.                 ZahtevZaDuel[playerid] = -1;
  762.             }
  763.         }
  764.     }
  765.     return 1;
  766. }
  767. //----------------------------------------------------------------------------//
  768. public OnPlayerSpawn(playerid)
  769. {
  770.     UlogovanIgrac[playerid] = true;
  771.     SendClientMessage(playerid, 0x0077C7FF, "========== {FFFFFF}ATROX DM{0077C7} ==========");
  772.     SendClientMessage(playerid, 0x0077C7FF, "Dobrodosli na {FFFFFF}ATROX DM !");
  773.     SendClientMessage(playerid, 0x0077C7FF, "Da vidite listu komadni, kucajte {FFFFFF}/help");
  774.     SendClientMessage(playerid, 0x0077C7FF, "Ugodnu igru na serveru zeli vam {FFFFFF}A-DM Staff Team !");
  775.     //------------------------------------------------------------------------//
  776.     for(new i; i < 9; i++) TextDrawShowForPlayer(playerid, InGameTD[i]);
  777.     PlayerTextDrawShow(playerid, KillsTD[playerid]); PlayerTextDrawShow(playerid, DeathsTD[playerid]);
  778.     PlayerTextDrawShow(playerid, RankTD[playerid]); PlayerTextDrawShow(playerid, NickTD[playerid]);
  779.     new str[30];
  780.     format(str, sizeof(str), "%d", PI[playerid][pKills]);
  781.     PlayerTextDrawSetString(playerid, KillsTD[playerid], str);
  782.     format(str, sizeof(str), "%d", PI[playerid][pDeaths]);
  783.     PlayerTextDrawSetString(playerid, DeathsTD[playerid], str);
  784.     format(str, sizeof(str), "%s", IgracevRank[playerid]);
  785.     PlayerTextDrawSetString(playerid, RankTD[playerid], str);
  786.     format(str, sizeof(str), "%s", ImeIgraca(playerid));
  787.     PlayerTextDrawSetString(playerid, NickTD[playerid], str);
  788.     //------------------------------------------------------------------------//
  789.     SetPlayerSkin(playerid, PI[playerid][pSkin]);
  790.     return 1;
  791. }
  792. //----------------------------------------------------------------------------//
  793. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  794. {
  795.     if(UDMAreni[playerid] == 0 && UDMAreni[issuerid] == 0)
  796.     {
  797.         new Float:hp;
  798.         GetPlayerHealth(playerid, hp);
  799.         SetPlayerHealth(playerid, hp+amount);
  800.         if(weaponid > 0)
  801.         {
  802.             new str[150];
  803.             format(str, sizeof(str), "[A-AC] {FFFFFF}Igrac %s ima oruzije ID: %d na spawnu!", ImeIgraca(issuerid), weaponid);
  804.             ResetPlayerWeapons(issuerid);
  805.             SendAdminMessage(0x0077C7FF, str);
  806.         }
  807.     }
  808.     return 1;
  809. }
  810. //----------------------------------------------------------------------------//
  811. public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
  812. {
  813.     if(!UlogovanIgrac[playerid])
  814.     {
  815.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Morate biti ulogovani kako biste koristili komande.");
  816.         return 0;
  817.     }
  818.     if(result == -1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Nepoznata komanda, za listu komandi - /help !");
  819.     new chatcd = gettime();
  820.     if(chatcd < (CMDCD[playerid] + 3) && PI[playerid][pAdmin] < 1)
  821.     {
  822.         SendClientMessage(playerid, 0x0077C7FF, "[A-AC] {FFFFFF}Mozete koristiti komandu svakih 3 sekunde.");
  823.         return 0;
  824.     }
  825.     CMDCD[playerid] = gettime();
  826.     return 1;
  827. }
  828. //---------------------------- FORWARD + PUBLIC ------------------------------//
  829. forward DuelOTimer(playerid, id);
  830. public DuelOTimer(playerid, id)
  831. {
  832.     new str[10];
  833.     SekundeDuel[playerid]--;
  834.     format(str, sizeof(str), "~r~%d", SekundeDuel[playerid]);
  835.     GameTextForPlayer(playerid, str, 1000, 3);
  836.     GameTextForPlayer(id, str, 1000, 3);
  837.     if(SekundeDuel[playerid] == 0)
  838.     {
  839.         GameTextForPlayer(playerid, "~g~GO go GO", 2000, 3);
  840.         GameTextForPlayer(id, "~g~GO go GO", 2000, 3);
  841.         TogglePlayerControllable(playerid, true);
  842.         KillTimer(TimerODuel[playerid]);
  843.         TogglePlayerControllable(id, true);
  844.     }
  845.     return 1;
  846. }
  847. //----------------------------------------------------------------------------//
  848. forward OnCheatDetected(playerid, ip_address[], type, code);
  849. public OnCheatDetected(playerid, ip_address[], type, code)
  850. {
  851.     if(!NexACDetect[playerid])
  852.     {
  853.         new str[200];
  854.         format(str, sizeof(str), "[A-AC] {FFFFFF}Igrac %s moguce da ima %d hack, koristi /spec %d !", ImeIgraca(playerid), playerid);
  855.         SendAdminMessage(0x0077C7FF, str);
  856.     }
  857.     return 1;
  858. }
  859. //----------------------------------------------------------------------------//
  860. forward public OnPlayerDataCheck(playerid, corrupt_check);
  861. public OnPlayerDataCheck(playerid, corrupt_check)
  862. {
  863.     if (corrupt_check != Corrupt_Check[playerid]) return Kick(playerid);
  864.     //------------------------------------------------------------------------//
  865.     new String[150];
  866.     //------------------------------------------------------------------------//
  867.     if(cache_num_rows() > 0)
  868.     {
  869.         cache_get_value(0, "PASSWORD", PI[playerid][pPassword], 65);
  870.         cache_get_value(0, "SALT", PI[playerid][pSalt], 11);
  871.         cache_get_value_name_int(0, "BANNED", PI[playerid][pBanned]);
  872.         cache_get_value(0, "BANREASON", PI[playerid][pBanReason], 50);
  873.         //--------------------------------------------------------------------//
  874.         if(PI[playerid][pBanned] == 1)
  875.         {
  876.             new str[200];
  877.             format(str, sizeof(str), "{FFFFFF}BANNED !\n\nAdmin Vas je banovao. Razlog: %s.\nUkoliko ovo smatrate greskom, prijavite na forum.\nForum:www.atrox.epizy.com", PI[playerid][pBanReason]);
  878.             ShowPlayerDialog(playerid, DIALOG_NORESPONSE, DIALOG_STYLE_MSGBOX, "{0077C7}ATROX {0077C7}D{FFFFFF}M", str, "U redu","");
  879.             Agg_Kick(playerid);
  880.             return 1;
  881.         }
  882.         //--------------------------------------------------------------------//
  883.         PI[playerid][Player_Cache] = cache_save();
  884.         //--------------------------------------------------------------------//
  885.         format(String, sizeof(String), "{FFFFFF}Dobrodosao nazad, {0077C7}%s.\n\n{FFFFFF}Upisite lozinku kako biste nastavili sa igrom.", PI[playerid][pName]);
  886.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{0077C7}ATROX {0077C7}D{FFFFFF}M", String, "Login", "Izlaz");
  887.     }
  888.     else
  889.     {
  890.         format(String, sizeof(String), "{FFFFFF}Dobrodosao {0077C7}%s.\n\n{FFFFFF}Upisite zeljenu lozinku kako biste napravili nalog.\n\n", PI[playerid][pName]);
  891.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{0077C7}ATROX {0077C7}D{FFFFFF}M", String, "Register", "Izlaz");
  892.     }
  893.     return 1;
  894. }
  895. //----------------------------------------------------------------------------//
  896. forward public OnPlayerRegister(playerid);
  897. public OnPlayerRegister(playerid)
  898. {
  899.     SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Uspesno ste kreirali nalog.");
  900.     SetSpawnInfo(playerid, 0, PI[playerid][pSkin], 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  901.     SpawnPlayer(playerid);
  902.     return 1;
  903. }
  904. //----------------------------------------------------------------------------//
  905. forward Agg_Kick(playerid);
  906. public Agg_Kick(playerid)
  907. {
  908.     SetTimerEx("KickIgraca", 500, false, "d", playerid);
  909.     return 1;
  910. }
  911. //----------------------------------------------------------------------------//
  912. forward KickIgraca(playerid);
  913. public KickIgraca(playerid)
  914. {
  915.     Kick(playerid);
  916.     return 1;
  917. }
  918. //-------------------------------- FUNCTIONS ---------------------------------//
  919. SendAdminMessage(color, string[])
  920. {
  921.     for(new i; i < MAX_PLAYERS; i++)
  922.     {
  923.         if(IsPlayerConnected(i) && PI[i][pAdmin] > 0)
  924.         {
  925.             SendClientMessage(i, color, string);
  926.         }
  927.     }
  928.     return 1;
  929. }
  930. //----------------------------------------------------------------------------//
  931. ImeIgraca(id)
  932. {
  933.     new ime[MAX_PLAYER_NAME];
  934.     GetPlayerName(id, ime, sizeof ime);
  935.     return ime;
  936. }
  937. //----------------------------------------------------------------------------//
  938. GetName(playerid)
  939. {
  940.     new name[MAX_PLAYER_NAME];
  941.     GetPlayerName(playerid, name, sizeof(name));
  942.     return name;
  943. }
  944. //-------------------------------- Admin's Commands --------------------------//
  945. CMD:makeadmin(playerid, params[])
  946. {
  947.     new id, lvl, str[250], DB_Query[200];
  948.     if(PI[playerid][pAdmin] < 3 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste ovlasceni.");
  949.     if(sscanf(params, "ud", id, lvl)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/makeadmin [ID] [Level 0-3]");
  950.     if(!UlogovanIgrac[id]) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac nije ulogovan.");
  951.     if(lvl < 0 || lvl > 3) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Level admina 0-3.");
  952.     if(lvl == PI[id][pAdmin]) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac vec ima admina tog levela.");
  953.     if(!strcmp(ImeIgraca(id), "Aggressive", true) && lvl < PI[id][pAdmin])
  954.     {
  955.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pokusao si Aggressive da spustis admin level? Prijavljen si!");
  956.         format(str, sizeof(str), "Igrac %s je pokusao da ti spusti admin level na %d !", ImeIgraca(playerid), lvl);
  957.         SendClientMessage(id, 0xFF1414FF, str);
  958.         return 1;
  959.     }
  960.     new Year, Month, Day, Hour, Minute, Second;
  961.     getdate(Year, Month, Day);
  962.     gettime(Hour, Minute, Second);
  963.     if(lvl == 0)
  964.     {
  965.         PI[id][pAdmin] = 0;
  966.         format(str, sizeof(str), "[A-AC] {FFFFFF}Admin %s je skinuo admina igracu %s.", ImeIgraca(playerid), ImeIgraca(id));
  967.         SendAdminMessage(0x0077C7FF, str);
  968.         format(str, sizeof(str), "[A-DM] {FFFFFF}Admin %s Vam je skinuo admina.", ImeIgraca(playerid));
  969.         SendClientMessage(id, 0x0077C7FF, "============= {FFFFFF}SKIDANJE ADMINA {0077C7}=============");
  970.         SendClientMessage(id, 0x0077C7FF, str);
  971.         SendClientMessage(id, 0x0077C7FF, "[A-DM] {FFFFFF}Ukoliko imate zalbu, postavite na forum.");
  972.         SendClientMessage(id, 0x0077C7FF, "[A-DM] {FFFFFF}www.atrox.epizy.com");
  973.         format(str, sizeof(str), "[A-DM] {FFFFFF}%d.%d.%d. %d:%d:%d", Day, Month, Year, Hour, Minute, Second);
  974.         SendClientMessage(id, 0x0077C7FF, str);
  975.         mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `ADMIN` = %d WHERE `ID` = %d LIMIT 1",
  976.         PI[id][pAdmin], PI[id][pID]);
  977.         mysql_tquery(Database, DB_Query);
  978.     }
  979.     else if(lvl < PI[id][pAdmin])
  980.     {
  981.         PI[id][pAdmin] = lvl;
  982.         format(str, sizeof(str), "[A-AC] {FFFFFF}Admin %s je spustio admina igracu %s na %d.", ImeIgraca(playerid), ImeIgraca(id), lvl);
  983.         SendAdminMessage(0x0077C7FF, str);
  984.         format(str, sizeof(str), "[A-DM] {FFFFFF}Admin %s Vam je spustio admin level na %d.", ImeIgraca(playerid), lvl);
  985.         SendClientMessage(id, 0x0077C7FF, "============= {FFFFFF}SPUSTANJE ADMIN LEVELA {0077C7}=============");
  986.         SendClientMessage(id, 0x0077C7FF, str);
  987.         SendClientMessage(id, 0x0077C7FF, "[A-DM] {FFFFFF}Ukoliko imate zalbu, postavite na forum.");
  988.         SendClientMessage(id, 0x0077C7FF, "[A-DM] {FFFFFF}www.atrox.epizy.com");
  989.         format(str, sizeof(str), "[A-DM] {FFFFFF}%d.%d.%d. %d:%d:%d", Day, Month, Year, Hour, Minute, Second);
  990.         SendClientMessage(id, 0x0077C7FF, str);
  991.         mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `ADMIN` = %d WHERE `ID` = %d LIMIT 1",
  992.         PI[id][pAdmin], PI[id][pID]);
  993.         mysql_tquery(Database, DB_Query);
  994.     }
  995.     else if(lvl > PI[id][pAdmin])
  996.     {
  997.         format(str, sizeof(str), "{FFFFFF}Cestitamo!\n\nPostali ste admin level {0077C7}%d{FFFFFF}.\nAdmina %d Vam je dao admin %s.\n\nSrecno, opdavdajte svoju poziciju!", lvl, lvl, ImeIgraca(playerid));
  998.         ShowPlayerDialog(id, DIALOG_NORESPONSE, DIALOG_STYLE_MSGBOX, "{0077C7}ATROX {0077C7}D{FFFFFF}M", str, "U redu","");
  999.         format(str, sizeof(str), "[A-AC] {FFFFFF}Admin %s je dao admina level %d igracu %s.", ImeIgraca(playerid), lvl, ImeIgraca(id));
  1000.         SendAdminMessage(0x0077C7FF, str);
  1001.         PI[id][pAdmin] = lvl;
  1002.         mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `ADMIN` = %d WHERE `ID` = %d LIMIT 1",
  1003.         PI[id][pAdmin], PI[id][pID]);
  1004.         mysql_tquery(Database, DB_Query);
  1005.     }
  1006.     return 1;
  1007. }
  1008. CMD:ban(playerid, params[])
  1009. {
  1010.     new id, razlog[50], str[200];
  1011.     if(PI[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste ovlasceni.");
  1012.     if(sscanf(params, "us[50]", id, razlog)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/ban [ID] [Razlog]");
  1013.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pogresan ID.");
  1014.     if(!strcmp(ImeIgraca(id), "Aggressive", true))
  1015.     {
  1016.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pokusao si Aggressive da banujes? Prijavljen si!");
  1017.         format(str, sizeof(str), "Igrac %s je pokusao da te banuje !", ImeIgraca(playerid));
  1018.         SendClientMessage(id, 0xFF1414FF, str);
  1019.         return 1;
  1020.     }
  1021.     if(PI[id][pAdmin] > PI[playerid][pAdmin])
  1022.     {
  1023.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pokusao si veceg admina od sebe da banujes? Prijavljen si!");
  1024.         format(str, sizeof(str), "Igrac %s je pokusao da te banuje !", ImeIgraca(playerid));
  1025.         SendClientMessage(id, 0xFF1414FF, str);
  1026.         return 1;
  1027.     }
  1028.     new Year, Month, Day, Hour, Minute, Second, query[150];
  1029.     getdate(Year, Month, Day);
  1030.     gettime(Hour, Minute, Second);
  1031.     format(str, sizeof(str), "[BAN] {FFFFFF}Igrac %s je banovan od strane admina. Razlog: {0077C7}%s.", ImeIgraca(id), razlog);
  1032.     SendClientMessageToAll(0x0077C7FF, str);
  1033.     format(str, sizeof(str), "[A-AC] {FFFFFF}Admin %s je banovao %s. Razlog: %s.", ImeIgraca(playerid), ImeIgraca(id), razlog);
  1034.     SendAdminMessage(0x0077C7FF, str);
  1035.     format(str, sizeof(str), "{FFFFFF}BANNED !\n\nAdmin %s Vas je banovao. Razlog: %s.\nUkoliko ovo smatrate greskom, prijavite na forum.\nForum:www.atrox.epizy.com\n\n%d.%d.%d. %d:%d:%d", ImeIgraca(playerid), razlog, Day, Month, Year, Hour, Minute, Second);
  1036.     ShowPlayerDialog(playerid, DIALOG_NORESPONSE, DIALOG_STYLE_MSGBOX, "{0077C7}ATROX {0077C7}D{FFFFFF}M", str, "U redu","");
  1037.     mysql_format(Database, query, sizeof(query), "UPDATE `PLAYERS` SET `BANNED` = '1', `BANREASON` = '%s' WHERE `ID` = %d LIMIT 1", razlog, PI[id][pID]);
  1038.     mysql_tquery(Database, query);
  1039.     Agg_Kick(id);
  1040.     return 1;
  1041. }
  1042. CMD:unban(playerid, params[])
  1043. {
  1044.     new pname[MAX_PLAYER_NAME], str[80], query[130];
  1045.     if(PI[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste ovlasceni.");
  1046.     if(sscanf(params, "s[MAX_PLAYER_NAME]", pname)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/unban [Ime Igraca]");
  1047.     mysql_format(Database, query, sizeof(query), "UPDATE `PLAYERS` SET `BANNED` = '0', `BANREASON` = 'NIJE BANOVAN' WHERE `USERNAME` = '%s' LIMIT 1", pname);
  1048.     mysql_tquery(Database, query);
  1049.     format(str, sizeof(str), "[A-AC] {FFFFFF}Admin %s je unban %s.", ImeIgraca(playerid), pname);
  1050.     SendAdminMessage(0x0077C7FF, str);
  1051.     return 1;
  1052. }
  1053. CMD:kick(playerid, params[])
  1054. {
  1055.     new id, razlog[50], str[200];
  1056.     if(PI[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste ovlasceni.");
  1057.     if(sscanf(params, "us[50]", id, razlog)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/kick [ID] [Razlog]");
  1058.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pogresan ID.");
  1059.     if(!strcmp(ImeIgraca(id), "Aggressive", true))
  1060.     {
  1061.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pokusao si Aggressive da kickujes? Prijavljen si!");
  1062.         format(str, sizeof(str), "Igrac %s je pokusao da te kickuje !", ImeIgraca(playerid));
  1063.         SendClientMessage(id, 0xFF1414FF, str);
  1064.         return 1;
  1065.     }
  1066.     if(PI[id][pAdmin] > PI[playerid][pAdmin])
  1067.     {
  1068.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Pokusao si veceg admina od sebe da kickujes? Prijavljen si!");
  1069.         format(str, sizeof(str), "Igrac %s je pokusao da te kickuje !", ImeIgraca(playerid));
  1070.         SendClientMessage(id, 0xFF1414FF, str);
  1071.         return 1;
  1072.     }
  1073.     format(str, sizeof(str), "[KICK] {FFFFFF}Izbaceni ste sa servera. Razlog: {0077C7}%s.", razlog);
  1074.     SendClientMessage(playerid, 0x0077C7FF, str);
  1075.     format(str, sizeof(str), "[A-AC] {FFFFFF}Admin %s je kick %s. Razlog: %s.", ImeIgraca(playerid), ImeIgraca(id), razlog);
  1076.     SendAdminMessage(0x0077C7FF, str);
  1077.     Agg_Kick(id);
  1078.     return 1;
  1079. }
  1080. CMD:gethere(playerid,params[])
  1081. {
  1082.     new id, targetid, Float:x, Float:y, Float:z;
  1083.     if(PI[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste ovlasceni.");
  1084.     if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/gethere [ID]");
  1085.     if(!UlogovanIgrac[id]) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac nije ulogovan.");
  1086.     GetPlayerPos(playerid, x, y, z);
  1087.     SetPlayerPos(targetid, x+1, y+1, z);
  1088.     return 1;
  1089. }
  1090. CMD:askin(playerid, params[])
  1091. {
  1092.     if(PI[playerid][pAdmin] < 1)
  1093.     {
  1094.         new id, pplayerid, skin, skinid, string[128];
  1095.         if(sscanf(params, "ui", pplayerid,skin)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/askin [ID/Ime_Prezime][ID/Skin]");
  1096.         if(!UlogovanIgrac[id]) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac nije ulogovan.");
  1097.         if(skinid < 0 || skinid > 311) SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}ID Skina 0-311");
  1098.         PI[pplayerid][pSkin] = skin;
  1099.         SetPlayerSkin(pplayerid, skin);
  1100.         format(string, sizeof(string), "{FFFFFF}[A-DM] {ffffff}Admin %s vam je setovao skin ID %d!",GetName(playerid),skin);
  1101.         SendClientMessage(pplayerid,-1,string);
  1102.         format(string, sizeof(string), "{FFFFFF}[A-DM] {ffffff}Uspesno ste postavili skin igracu %s!",GetName(pplayerid));
  1103.         SendClientMessage(playerid,-1,string);
  1104.     }
  1105.     else
  1106.     {
  1107.         SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste ovlasceni.");
  1108.     }
  1109.     return 1;
  1110. }
  1111. //------------------------------ Player's Commands ---------------------------//
  1112. CMD:dm(playerid, params[])
  1113. {
  1114.     if(UDMAreni[playerid] > 0) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Prvo izadjite iz DM arene, /lobby !");
  1115.     if(DuelIgrac[playerid] != -1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Prvo izadjite iz duela, /napustiduel !");
  1116.     new string[280];
  1117.     format(string, sizeof(string), "LVPD (%d/10 igraca)\nGhost Town (%d/10 igraca)\nRC Battlefield (%d/10 igraca)\nJeferson Motel (%d/10 igraca)\nMeat Factory (%d/10 igraca)", InDM1, InDM2, InDM3, InDM4, InDM5);
  1118.     ShowPlayerDialog(playerid, DIALOG_DMARENE, DIALOG_STYLE_LIST, "{0077C7}ATROX {0077C7}D{FFFFFF}M", string, "Izaberi","Izlaz");
  1119.     return 1;
  1120. }
  1121. CMD:duel(playerid, params[])
  1122. {
  1123.     new id, w1, w2, wa1, wa2, Float:hp, Float:ar, str[150];
  1124.     if(sscanf(params, "uddddff", id, w1, w2, wa1, wa2, hp, ar)) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/duel [ID] [Weapon 1] [Weapon 2] [Weapon Ammo 1] [Weapon Ammo 2] [Health] [Armour]");
  1125.     if(w1 < 1 || w1 > 34 || w2 < 1 || w2 > 34) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}ID Oruzija 1-34");
  1126.     if(wa1 < 50 || wa2 < 50) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Municija oruzija (Ammo) ne sme biti manja od 50.");
  1127.     if(hp < 10 || hp > 100 || ar > 100 || ar < 0) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Health 10-100, Armour 0-100");
  1128.     if(!UlogovanIgrac[id]) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac nije ulogovan.");
  1129.     if(UDMAreni[playerid] > 0) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Prvo izadjite iz DM arene, /lobby !");
  1130.     if(DuelIgrac[playerid] != -1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Vec ste u duelu.");
  1131.     if(DuelIgrac[id] != -1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac je vec u duelu.");
  1132.     if(ZahtevZaDuel[playerid] != -1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Vec ste poslali zahtev.");
  1133.     if(ZahtevZaDuel[id] != -1) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Taj igrac je vec primio zahtev za duel.");
  1134.     //if(playerid == id) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Ne mozete samog sebe pozvati na duel.");
  1135.     format(str, sizeof(str), "{FFFFFF}Igrac %s Vas je izazvao na duel.\nDa prihvatite, pritisnite 'Prihvati'.\nDa odbijete, pritisnite 'Odbij'.", ImeIgraca(playerid));
  1136.     ShowPlayerDialog(id, DIALOG_DUEL, DIALOG_STYLE_MSGBOX, "{0077C7}ATROX {0077C7}D{FFFFFF}M", str, "Prihvati","Odbij");
  1137.     ZahtevZaDuel[id] = playerid;
  1138.     ZahtevZaDuel[playerid] = id;
  1139.     DuelOpcije[playerid][0] = w1; DuelOpcije[playerid][1] = w2;
  1140.     DuelOpcije[playerid][2] = wa1; DuelOpcije[playerid][3] = wa2;
  1141.     DuelHP[playerid] = hp; DuelArmour[playerid] = ar;
  1142.     SendClientMessage(playerid, 0x0077C7FF, "Poslali ste zahtev za duel.");
  1143.     return 1;
  1144. }
  1145. CMD:lobby(playerid, params[])
  1146. {
  1147.     if(UDMAreni[playerid] == 0) return SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}Niste u DM areni.");
  1148.     ResetPlayerWeapons(playerid);
  1149.     UDMAreni[playerid] = 0;
  1150.     SetPlayerPos(playerid, 1958.33, 1343.12, 15.36);
  1151.     SetPlayerVirtualWorld(playerid, 0);
  1152.     SetPlayerInterior(playerid, 0);
  1153.     return 1;
  1154. }
  1155. CMD:skin(playerid,params[])
  1156. {
  1157.     new skinnumber, skinid, string[128];
  1158.     if(sscanf(params, "d", skinid)) SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}/skin [ID]");
  1159.     else if(skinid < 1 || skinid > 299) SendClientMessage(playerid, 0x0077C7FF, "[A-DM] {FFFFFF}ID Skina 1-299");
  1160.     else
  1161.     {
  1162.         SetPlayerSkin(playerid, skinid);
  1163.         skinnumber = GetPlayerSkin(playerid);
  1164.         format(string, sizeof(string), "{FFFFFF}[A-DM] {ffffff}Uspijesno ste promijenili skin %d", skinnumber);
  1165.         SendClientMessage(playerid, -1, string);
  1166.     }
  1167.     return 1;
  1168. }
  1169. CMD:help(playerid, params[])
  1170. {
  1171.     ShowPlayerDialog(playerid, DIALOG_NORESPONSE, DIALOG_STYLE_MSGBOX, "{0077C7}ATROX {0077C7}D{FFFFFF}M", "/dm /duel /lobby /skin", "U redu","");
  1172.     return 1;
  1173. }
  1174. /*
  1175.             Zavrsetak skripte ATROX DM v1.0 by Aggressive
  1176.                       © All rights reserved
  1177. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top