SHE790

LS_GangWars

Jul 16th, 2014
1,346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 31.64 KB | None | 0 0
  1. //==================================Hi All====================================//
  2. //===============This is a simple gamemode scripted by SHE790=================//
  3. //=========================Thanks For Downloading=============================//
  4. //=============================So Lets Start==================================//
  5. //============================================================================//
  6.  
  7. //============================================================================//
  8. //===============================[Includes]===================================//
  9. //============================================================================//
  10. #include <a_samp>
  11. #include <YSI\y_ini>
  12. #include <zcmd>
  13. #include <foreach>
  14. #include <sscanf2>
  15. #include <streamer>
  16. //============================================================================//
  17. //================================[Teams]=====================================//
  18. //============================================================================//
  19. #define Grove 1
  20. #define Ballas 2
  21. #define Vagos 3
  22. #define Aztecas 4
  23. //============================================================================//
  24. //===============================[Colors]=====================================//
  25. //============================================================================//
  26. #define GroveColor   0x90EE90FF
  27. #define BallasColor  0xFFC0CBAA
  28. #define VagosColor 0xFFFF00FF
  29. #define AztecasColor 0x00FFFFFF
  30. #define LIGHTBLUE 0x00FFFFFF
  31. #define Red 0xFF0000FF
  32. #define WHITE 0xFFFFFFFF
  33. #define PINK 0xFF80FFFF
  34. #define Orange 0xFF8000FF
  35. //============================================================================//
  36. //============================[Dialogs and Enum]==============================//
  37. //============================================================================//
  38. #define SCM SendClientMessage
  39. #define DIALOG_REGISTER 1
  40. #define DIALOG_LOGIN 2
  41. #define PATH "Accounts/%s.ini"//Create a folder at your script files names Accounts
  42.  
  43. enum pInfo
  44. {
  45.     pPass,
  46.     pCash,
  47.     pAdmin,
  48.     pKills,
  49.     pSkin,
  50.     pDeaths,
  51.     pLogged,
  52.     pScore,
  53.     pBanned
  54. }
  55. new PlayerInfo[MAX_PLAYERS][pInfo];
  56. forward TimerForRemoveObj(playerid);
  57. new HitObjTime[MAX_PLAYERS];
  58. forward save_timer(playerid);
  59. new RedScreenTime[MAX_PLAYERS];
  60. new AdvTime[MAX_PLAYERS];
  61. new GroveVeh[20];
  62. new BallasVeh[20];
  63. new VagosVeh[20];
  64. new AztecasVeh[20];
  65. new Gang[MAX_PLAYERS];
  66. forward LoadUser_data(playerid,name[],value[]);
  67. new randomMessages[][] =
  68.     {
  69.         "[SERVER] Use /help to see all availbe commands",
  70.         "[SERVER] Dont Forget to read /rules",
  71.         "[SERVER] This GameMode is Scripted by SHE790"
  72.     };
  73.  
  74. forward RandomMessages();
  75. forward KickLog(string[]);
  76. forward BanLog(string[]);
  77. new apm = 0;
  78. //============================================================================//
  79. //================================[Stocks]====================================//
  80. //============================================================================//
  81. stock IsAGroveCar(carid)
  82. {
  83.     for(new v = 0; v < sizeof(GroveVeh); v++)
  84.     {
  85.         if(carid == GroveVeh[v]) return 1;
  86.     }
  87.     return 0;
  88. }
  89.  
  90. stock IsABallasCar(carid)
  91. {
  92.     for(new v = 0; v < sizeof(BallasVeh); v++)
  93.     {
  94.         if(carid == BallasVeh[v]) return 1;
  95.     }
  96.     return 0;
  97. }
  98.  
  99. stock IsAAztecasCar(carid)
  100. {
  101.     for(new v = 0; v < sizeof(AztecasVeh); v++)
  102.     {
  103.         if(carid == AztecasVeh[v]) return 1;
  104.     }
  105.     return 0;
  106. }
  107.  
  108. stock IsAVagosCar(carid)
  109. {
  110.     for(new v = 0; v < sizeof(VagosVeh); v++)
  111.     {
  112.         if(carid == VagosVeh[v]) return 1;
  113.     }
  114.     return 0;
  115. }
  116.  
  117. stock SendAdminMessage(text[])
  118. {
  119.     for(new i = 0; i < MAX_PLAYERS; i++)
  120.     {
  121.         if(PlayerInfo[i][pAdmin]>=1)
  122.         {
  123.             SendClientMessage(i,-1,text);
  124.         }
  125.     }
  126.     return true;
  127. }
  128.  
  129. stock GetName(playerid)
  130. {
  131. new name[24];
  132. GetPlayerName(playerid, name, 24);
  133. return name;
  134. }
  135.  
  136. stock sendername(playerid)
  137. {
  138.     new name[MAX_PLAYER_NAME];
  139.     GetPlayerName(playerid,name,sizeof(name));
  140.     for(new i = 0; i < MAX_PLAYER_NAME; i++)
  141.     {
  142.         if(name[i] == '_') name[i] = ' ';
  143.     }
  144.     return name;
  145. }
  146.  
  147. stock UserPath(playerid)
  148. {
  149.     new string[128],playername[MAX_PLAYER_NAME];
  150.     GetPlayerName(playerid,playername,sizeof(playername));
  151.     format(string,sizeof(string),PATH,playername);
  152.     return string;
  153. }
  154.  
  155. stock udb_hash(buf[]) {
  156.     new length=strlen(buf);
  157.     new s1 = 1;
  158.     new s2 = 0;
  159.     new n;
  160.     for (n=0; n<length; n++)
  161.     {
  162.         s1 = (s1 + buf[n]) % 65521;
  163.         s2 = (s2 + s1)     % 65521;
  164.     }
  165.     return (s2 << 16) + s1;
  166. }
  167. //============================================================================//
  168. //===============================[Publics]====================================//
  169. //============================================================================//
  170. new PlayerTotalKills[MAX_PLAYERS] = 0;
  171.  
  172. public OnFilterScriptInit()
  173. {
  174.     print(" LS Gang Wars Scripted By SHE790");
  175.     return 1;
  176. }
  177.  
  178. public OnFilterScriptExit()
  179. {
  180.     return 1;
  181. }
  182.  
  183.  
  184. main()
  185. {
  186.     print(" LS Gang Wars Scripted By SHE790");
  187. }
  188.  
  189. public OnGameModeInit()
  190. {
  191.     SetGameModeText("Gang Wars");
  192.     SetTimer("[Server]", 60000, true);
  193.     UsePlayerPedAnims( );
  194.     DisableInteriorEnterExits();
  195.     ShowPlayerMarkers( 0 );
  196.     ShowNameTags( 1 );
  197.     AllowAdminTeleport( 1 );
  198.     AddPlayerClass(107,2498.4844,-1643.2212,13.7826,177.4201,24,1000,27,1000,16,1000); // Grove
  199.     AddPlayerClass(102,2157.4907,-1708.4534,15.0859,359.4762,24,1000,27,1000,16,1000); // Ballas
  200.     AddPlayerClass(108,2373.7385,-1140.9768,28.4875,180.9356,24,1000,27,1000,16,1000); // Vagos
  201.     AddPlayerClass(115,1675.1875,-2121.0498,13.5469,313.4387,24,1000,27,1000,16,1000); // Aztecas
  202.     //Grove
  203.     GroveVeh[0] =AddStaticVehicleEx(412,2508.2393,-1671.7756,13.2177,347.2553,137,137,100); // Grove
  204.     GroveVeh[1] =AddStaticVehicleEx(412,2497.5012,-1655.6753,13.2261,81.8963,137,137,100); // Grove
  205.     GroveVeh[2] =AddStaticVehicleEx(412,2498.3628,-1682.1313,13.1994,101.8438,137,137,100); // Grove
  206.     GroveVeh[3] =AddStaticVehicleEx(468,2506.5999,-1660.9631,13.0868,31.8633,137,137,100); // Grove
  207.     GroveVeh[4] =AddStaticVehicleEx(468,2483.4285,-1654.7098,12.9793,94.5025,137,137,100); // Grove
  208.     GroveVeh[5] =AddStaticVehicleEx(468,2483.7700,-1683.8999,13.0923,78.5948,137,137,100); // Grove
  209.     //Ballas
  210.     BallasVeh[0] =AddStaticVehicleEx(468,2200.2395,-1675.1848,13.9413,346.5051,147,147,100); // Ballas
  211.     BallasVeh[1] =AddStaticVehicleEx(517,2187.2253,-1669.5668,14.3136,346.5294,147,147,100); // Ballas
  212.     BallasVeh[2] =AddStaticVehicleEx(517,2185.3005,-1678.7198,13.8870,346.3020,147,147,100); // Ballas
  213.     BallasVeh[3] =AddStaticVehicleEx(517,2183.6599,-1688.4922,13.5069,351.4986,147,147,100); // Ballas
  214.     BallasVeh[4] =AddStaticVehicleEx(517,2189.0186,-1659.4565,14.7839,347.0395,147,147,100); // Ballas
  215.     BallasVeh[5] =AddStaticVehicleEx(566,2194.6216,-1671.6973,14.2908,345.6134,147,147,100); // Ballas
  216.     BallasVeh[6] =AddStaticVehicleEx(566,2196.6353,-1660.9783,14.7388,349.4670,147,147,100); // Ballas
  217.     BallasVeh[7] =AddStaticVehicleEx(566,2192.5881,-1679.1763,13.8549,346.5743,147,147,100); // Ballas
  218.     BallasVeh[8] =AddStaticVehicleEx(566,2190.7188,-1687.8025,13.4751,348.8312,147,147,100); // Ballas
  219.     BallasVeh[9] =AddStaticVehicleEx(468,2202.2573,-1669.1936,14.1311,343.9594,147,147,100); // Ballas
  220.     BallasVeh[10] =AddStaticVehicleEx(468,2204.3901,-1659.8114,14.3785,343.0818,147,147,100); // Ballas
  221.     BallasVeh[11] =AddStaticVehicleEx(468,2198.9473,-1683.8168,13.6615,348.8855,147,147,100); // Ballas
  222.     BallasVeh[12] =AddStaticVehicleEx(468,2198.0110,-1691.3538,13.4698,352.6253,147,147,100); // Ballas
  223.     //Vagos
  224.     VagosVeh[0] =AddStaticVehicleEx(468,2359.7688,-1149.9063,27.0886,98.6411,194,194,100); // Vagos
  225.     VagosVeh[1] =AddStaticVehicleEx(468,2367.9280,-1149.3313,27.1143,91.0150,194,194,100); // Vagos
  226.     VagosVeh[2] =AddStaticVehicleEx(468,2376.2778,-1149.4939,27.1145,88.1634,194,194,100); // Vagos
  227.     VagosVeh[3] =AddStaticVehicleEx(468,2382.2590,-1149.3517,27.2547,90.7258,194,194,100); // Vagos
  228.     VagosVeh[4] =AddStaticVehicleEx(468,2390.3179,-1149.2836,28.1058,90.7143,194,194,100); // Vagos
  229.     VagosVeh[5] =AddStaticVehicleEx(468,2360.2288,-1158.7572,27.0978,87.9899,194,194,100); // Vagos
  230.     VagosVeh[6] =AddStaticVehicleEx(468,2383.2271,-1158.7882,27.3482,85.7300,194,194,100); // Vagos
  231.     VagosVeh[7] =AddStaticVehicleEx(474,2353.0935,-1151.0057,27.0248,93.0219,194,194,100); // Vagos
  232.     VagosVeh[8] =AddStaticVehicleEx(474,2367.2463,-1166.6875,27.1869,184.0016,194,194,100); // Vagos
  233.     VagosVeh[9] =AddStaticVehicleEx(474,2375.8801,-1161.5858,27.2459,170.6727,194,194,100); // Vagos
  234.     //Aztecas
  235.     AztecasVeh[0] =AddStaticVehicleEx(534,1683.7639,-2108.8086,13.1074,268.6805,246,246,100); // Aztecas
  236.     AztecasVeh[1] =AddStaticVehicleEx(534,1684.1537,-2116.3472,13.1743,273.1353,246,246,100); // Aztecas
  237.     AztecasVeh[2] =AddStaticVehicleEx(534,1692.8679,-2108.9844,13.1069,267.6172,246,246,100); // Aztecas
  238.     AztecasVeh[3] =AddStaticVehicleEx(534,1692.7073,-2116.1497,13.1091,270.2408,246,246,100); // Aztecas
  239.     AztecasVeh[4] =AddStaticVehicleEx(575,1701.3755,-2115.8735,12.9861,269.9332,246,246,100); // Aztecas
  240.     AztecasVeh[5] =AddStaticVehicleEx(575,1700.1849,-2108.9976,12.9843,271.3449,246,246,100); // Aztecas
  241.     AztecasVeh[6] =AddStaticVehicleEx(468,1704.8351,-2108.9812,13.0520,271.2786,246,246,100); // Aztecas
  242.     AztecasVeh[7] =AddStaticVehicleEx(468,1705.4651,-2115.7566,13.0519,271.7458,246,246,100); // Aztecas
  243.     AztecasVeh[8] =AddStaticVehicleEx(468,1681.9119,-2112.7720,13.1349,268.4475,246,246,100); // Aztecas
  244.     return 1;
  245. }
  246. public OnGameModeExit()
  247. {
  248.     return 1;
  249. }
  250.  
  251. public KickLog(string[])
  252. {
  253.     new entry[256];
  254.     format(entry, sizeof(entry), "%s\n",string);
  255.     new File:hFile;
  256.     hFile = fopen("Logs/kick.log", io_append);
  257.     fwrite(hFile, entry);
  258.     fclose(hFile);
  259. }
  260. public BanLog(string[])
  261. {
  262.     new entry[256];
  263.     format(entry, sizeof(entry), "%s\n",string);
  264.     new File:hFile;
  265.     hFile = fopen("Logs/ban.log", io_append);
  266.     fwrite(hFile, entry);
  267.     fclose(hFile);
  268. }
  269.  
  270. public OnPlayerConnect(playerid)
  271. {
  272.  
  273.     if(fexist(UserPath(playerid)))
  274.     {
  275.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  276.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Account Login","Type your password below to login.","Login","Quit");
  277.     }
  278.     else
  279.     {
  280.         new string[125];
  281.         format(string,sizeof(string),"Hello %s.\nYou're not registered please register.",sendername(playerid));
  282.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Account Register",string,"Register","Later");
  283.     }
  284.     HitObjTime[playerid] = 0;
  285.     RedScreenTime[playerid] = 0;
  286.     AdvTime[playerid] = 0;
  287.     return 1;
  288. }
  289.  
  290. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  291. {
  292. switch( dialogid )
  293.     {
  294.         case DIALOG_REGISTER:
  295.         {
  296.         if (!response) return Kick(playerid);
  297.         if(response)
  298.             {
  299.         if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Account Registeration","You've entered an invalid password./nType a password below to join the community.","Register","Leave");
  300.         new INI:File = INI_Open(UserPath(playerid));
  301.         INI_SetTag(File,"data");
  302.         INI_WriteInt(File,"Password",udb_hash(inputtext));
  303.         INI_WriteInt(File,"Cash",0);
  304.         INI_WriteInt(File,"Admin",0);
  305.         INI_WriteInt(File,"Kills",0);
  306.         INI_WriteInt(File,"Deaths",0);
  307.         INI_WriteInt(File,"Score",1);
  308.         INI_Close(File);
  309.             }
  310.         }
  311.         case DIALOG_LOGIN:
  312.         {
  313.         if (!response) return Kick (playerid);
  314.         if(response)
  315.             {
  316.         if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  317.                 {
  318.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  319.         GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  320.         SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
  321.         SCM(playerid,VagosColor,"You have successfully logged in, {FFFFFF}Welcome!");
  322.         PlayerInfo[playerid][pLogged] = 1;
  323.                 }
  324.         else
  325.                 {
  326.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Account Login","You have entered an invalid password.\nType your password below to login.","Login","Quit");
  327.                 }
  328.         return 1;
  329.             }
  330.         }
  331.     }
  332. return 1;
  333. }
  334.  
  335. public LoadUser_data(playerid,name[],value[])
  336. {
  337.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  338.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  339.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  340.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  341.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  342.     INI_Int("pBanned",PlayerInfo[playerid][pBanned]);
  343.     INI_Int("Score",PlayerInfo[playerid][pScore]);
  344.     return 1;
  345. }
  346.  
  347. public save_timer(playerid)
  348. {
  349.     if(PlayerInfo[playerid][pLogged] == 1)
  350.     {
  351.         new INI:File = INI_Open(UserPath(playerid));
  352.         INI_SetTag(File,"data");
  353.         INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  354.         INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  355.         INI_WriteInt(File,"pBanned",PlayerInfo[playerid][pBanned]);
  356.         INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  357.         INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  358.         INI_WriteInt(File,"Score",GetPlayerScore(playerid));
  359.         INI_Close(File);
  360.     }
  361.     return 1;
  362. }
  363.  
  364. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  365. {
  366. if(!success)SendClientMessage(playerid, -1, "This command does not exists use /help to see available commands");
  367. return 1;
  368. }
  369.  
  370. public RandomMessages()
  371. {
  372.     new randomMsg = random(sizeof(randomMessages));
  373.     SendClientMessageToAll(BallasColor, randomMessages[randomMsg]);
  374. }
  375.  
  376. public OnPlayerSpawn(playerid)
  377. {
  378.     if(GetPlayerTeam(playerid) == Grove)
  379.     {
  380.         SetPlayerColor(playerid, GroveColor);
  381.         GameTextForPlayer(playerid, "~g~Your Part of Grove Family", 3000, 3);
  382.         GivePlayerWeapon(playerid, 24, 1000);
  383.         GivePlayerWeapon(playerid, 27, 1000);
  384.         GivePlayerWeapon(playerid, 16, 1000);
  385.     }
  386.     else if(GetPlayerTeam(playerid) == Ballas)
  387.     {
  388.         SetPlayerColor(playerid, BallasColor);
  389.         GameTextForPlayer(playerid, "~r~Your Part of Ballas Family", 3000, 3);
  390.         GivePlayerWeapon(playerid, 24, 1000);
  391.         GivePlayerWeapon(playerid, 27, 1000);
  392.         GivePlayerWeapon(playerid, 16, 1000);
  393.     }
  394.         else if(GetPlayerTeam(playerid) == Vagos)
  395.     {
  396.         SetPlayerColor(playerid, VagosColor);
  397.         GameTextForPlayer(playerid, "~r~Your Part of Vagos Family", 3000, 3);
  398.         GivePlayerWeapon(playerid, 24, 1000);
  399.         GivePlayerWeapon(playerid, 27, 1000);
  400.         GivePlayerWeapon(playerid, 16, 1000);
  401.     }
  402.             else if(GetPlayerTeam(playerid) == Aztecas)
  403.     {
  404.         SetPlayerColor(playerid, AztecasColor);
  405.         GameTextForPlayer(playerid, "~r~Your Part of Aztecas Family", 3000, 3);
  406.         GivePlayerWeapon(playerid, 24, 1000);
  407.         GivePlayerWeapon(playerid, 27, 1000);
  408.         GivePlayerWeapon(playerid, 16, 1000);
  409.     }
  410.     return 1;
  411. }
  412.  
  413. public OnPlayerDeath(playerid, killerid, reason)
  414. {
  415.     PlayerInfo[killerid][pKills]++;
  416.     PlayerInfo[playerid][pDeaths]++;
  417.     SendDeathMessage(killerid, playerid, reason);
  418.     if(killerid != INVALID_PLAYER_ID)
  419.     {
  420.         SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  421.         GivePlayerMoney(killerid, 5000);
  422.         GameTextForPlayer(killerid, "~W~Nice~Y~Shot !~n~~R~Got $5000 & 1 Score", 3000, 1);
  423.     }
  424.     return 1;
  425. }
  426.  
  427.     public OnPlayerRequestClass(playerid, classid)
  428.    {
  429.     SetPlayerPos(playerid,1588.5428,-1370.3191,330.0635);
  430.     SetPlayerCameraPos(playerid, 1558.5428,-1370.3191,330.0635);
  431.     SetPlayerCameraLookAt(playerid, 1558.5428,-1370.3191,330.0635);
  432.     switch(classid)
  433.          {
  434.          case 0:
  435.          {
  436.               SetPlayerTeam(playerid, Grove);
  437.               GameTextForPlayer(playerid, "~g~Grove Gang", 3000, 3);
  438.          }
  439.          case 1:
  440.          {
  441.               SetPlayerTeam(playerid, Ballas);
  442.               GameTextForPlayer(playerid, "~b~Ballas Gang", 3000, 3);
  443.          }
  444.          case 2:
  445.          {
  446.               SetPlayerTeam(playerid, Vagos);
  447.               GameTextForPlayer(playerid, "~y~Vagos Gang", 3000, 3);
  448.          }
  449.          case 3:
  450.          {
  451.               SetPlayerTeam(playerid, Aztecas);
  452.               GameTextForPlayer(playerid, "~lb~Aztecas Gang", 3000, 3);
  453.          }
  454.          }
  455.     new Name[128],string[126],killerid;
  456.     GetPlayerName(killerid, Name, sizeof(Name));
  457.     PlayerTotalKills[killerid]++;
  458.     PlayerTotalKills[playerid] = 0;
  459.     if(PlayerTotalKills[killerid] == 1) {
  460.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/firstblood.mp3");
  461.         format(string, sizeof(string), "~r~%s FIRST BLOOD", Name);
  462.         GameTextForAll(string, 6000,3);
  463.     }
  464.     if(PlayerTotalKills[killerid] == 2) {
  465.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/doublekill.mp3");
  466.         format(string, sizeof(string), "~r~%s DOUBLE KILL.", Name);
  467.         GameTextForAll(string, 6000,3);
  468.         return 1;
  469.     }
  470.     if(PlayerTotalKills[killerid] == 3) {
  471.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/killingspree.mp3");
  472.         format(string, sizeof(string), "~r~%s TRIPLE KILL", Name);
  473.         GameTextForAll(string, 6000,3);
  474.         return 1;
  475.     }
  476.     if(PlayerTotalKills[killerid] == 4) {
  477.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/dominating.mp3");
  478.         format(string, sizeof(string), "~r~%s IS DOMINATING", Name);
  479.         GameTextForAll(string, 6000,3);
  480.         return 1;
  481.     }
  482.     if(PlayerTotalKills[killerid] == 5) {
  483.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/triplekill.mp3");
  484.         format(string, sizeof(string), "~r~%s KILLING SPREE", Name);
  485.         GameTextForAll(string, 6000,3);
  486.         return 1;
  487.     }
  488.     if(PlayerTotalKills[killerid] == 7) {
  489.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/monsterkill.mp3");
  490.         format(string, sizeof(string), "~r~%s MONSTER KILL", Name);
  491.         GameTextForAll(string, 6000,3);
  492.         return 1;
  493.     }
  494.     if(PlayerTotalKills[killerid] == 9) {
  495.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/wickedsick.mp3");
  496.         format(string, sizeof(string), "~r~%s WICKED SICK", Name);
  497.         GameTextForAll(string, 6000,3);
  498.         return 1;
  499.     }
  500.     if(PlayerTotalKills[killerid] == 11) {
  501.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/ludicrouskill.mp3");
  502.         format(string, sizeof(string), "~r~%s LUDICROUS KILL", Name);
  503.         GameTextForAll(string, 6000,3);
  504.         return 1;
  505.     }
  506.     if(PlayerTotalKills[killerid] == 13) {
  507.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/ultrakill.mp3");
  508.         format(string, sizeof(string), "~r~%s ULTRA KILL", Name);
  509.         GameTextForAll(string, 6000,3);
  510.         return 1;
  511.     }
  512.     if(PlayerTotalKills[killerid] == 15) {
  513.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/unstoppable.mp3");
  514.         format(string, sizeof(string), "~r~%s IS UNSTOPPABLE", Name);
  515.         GameTextForAll(string, 6000,3);
  516.         return 1;
  517.     }
  518.     return 1;
  519. }
  520.  
  521. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  522. {
  523.     if(IsAGroveCar(vehicleid))
  524.     {
  525.         if(Gang[playerid] != 1)
  526.         {
  527.             new Float:x, Float:y, Float:z;
  528.             GetPlayerPos(playerid, x, y, z);
  529.             SetPlayerPos(playerid, x, y, z+0.5);
  530.             SendClientMessage(playerid, -1, "You are not part of the Grove Family.");
  531.         }
  532.         else
  533.         {
  534.             return 1;
  535.         }
  536.     }
  537.     if(IsABallasCar(vehicleid))
  538.     {
  539.         if(Gang[playerid] != 2)
  540.         {
  541.             new Float:x, Float:y, Float:z;
  542.             GetPlayerPos(playerid, x, y, z);
  543.             SetPlayerPos(playerid, x, y, z+0.5);
  544.             SendClientMessage(playerid, -1, "You are not part of The Ballas.");
  545.         }
  546.         else
  547.         {
  548.             return 1;
  549.         }
  550.     }
  551.     if(IsAAztecasCar(vehicleid))
  552.     {
  553.         if(Gang[playerid] != 3)
  554.         {
  555.             new Float:x, Float:y, Float:z;
  556.             GetPlayerPos(playerid, x, y, z);
  557.             SetPlayerPos(playerid, x, y, z+0.5);
  558.             SendClientMessage(playerid, -1, "You are not part of the Los Aztecas.");
  559.         }
  560.         else
  561.         {
  562.             return 1;
  563.         }
  564.     }
  565.     if(IsAVagosCar(vehicleid))
  566.     {
  567.         if(Gang[playerid] != 4)
  568.         {
  569.             new Float:x, Float:y, Float:z;
  570.             GetPlayerPos(playerid, x, y, z);
  571.             SetPlayerPos(playerid, x, y, z+0.5);
  572.             SendClientMessage(playerid, -1, "You are not part of the Los Santos Vagos.");
  573.         }
  574.         else
  575.         {
  576.             return 1;
  577.         }
  578.     }
  579.     return 1;
  580. }
  581.  
  582. //============================================================================//
  583. //================================[COMMANDS]==================================//
  584. //============================================================================//
  585. CMD:jetpack(playerid, params[])
  586. {
  587.         if(PlayerInfo[playerid][pAdmin] >= 1)
  588.         SetPlayerSpecialAction(playerid, 2);
  589.         return 1;
  590. }
  591.  
  592. CMD:slap(playerid, params[])
  593. {
  594.     if(PlayerInfo[playerid][pAdmin] >= 1)
  595.     {
  596.     new
  597.     targetid,Float:health,string[128],reason[48],Float:Pos[4];
  598.     if(sscanf(params, "us[48]", targetid,reason)) return SCM(playerid, -1, "USAGE: /slap [playerid] [reason]");
  599.     GetPlayerHealth(targetid,health); SetPlayerHealth(targetid,health-10);
  600.     GetPlayerPos(targetid, Pos[0], Pos[1], Pos[2]);
  601.     SetPlayerPos(targetid, Pos[0], Pos[1], Pos[2]+10);
  602.     format(string,sizeof(string),"Admin %s slaped %s|Reason: %s",GetName(playerid),GetName(targetid),reason);
  603.     SendClientMessageToAll(Red,string);
  604.         }
  605.     return 1;
  606. }
  607.  
  608. CMD:setscore(playerid,params[])
  609. {
  610.     if(PlayerInfo[playerid][pAdmin] >= 1)
  611.     {
  612.         new string[70],target,score;
  613.         if(sscanf(params,"ui",target,score)) return SCM(playerid,-1,"[USAGE] /setscore [PlayerID/PartOfName] [Score]");
  614.         if( target == INVALID_PLAYER_ID) return SCM(playerid,Red,"** Player not found.");
  615.         {
  616.             SetPlayerScore(target,score);
  617.             format(string,sizeof(string),"** You've set %s score to %d.",sendername(target),score);
  618.             SCM(playerid,AztecasColor,string);
  619.             format(string,sizeof(string),"** %s has set your score to %d.",sendername(playerid),score);
  620.             SCM(playerid,AztecasColor,string);
  621.         }
  622.     }
  623.     return 1;
  624. }
  625.  
  626. CMD:repair(playerid,params[])
  627. {
  628.     if(PlayerInfo[playerid][pAdmin] >= 1)
  629.     {
  630.         if(IsPlayerInAnyVehicle(playerid))
  631.         {
  632.             new vid;
  633.             vid = GetPlayerVehicleID(playerid);
  634.             RepairVehicle(vid);
  635.             SCM(playerid,AztecasColor,"** Vehicle successfully  repaired.");
  636.         } else SCM(playerid,Red,"** You are not in any vehicle.");
  637.  
  638.     }
  639.     else { SCM(playerid,-1,"Your not admin"); }
  640. }
  641.  
  642. CMD:ann(playerid,params[])
  643. {
  644.     if(PlayerInfo[playerid][pAdmin] >= 1)
  645.     {
  646.         new string[20];
  647.         if(sscanf(params,"s[20]",string)) return SCM(playerid,Red,"** /ann [Text]");
  648.         GameTextForAll(string,2000,5);
  649.     }
  650.     return 1;
  651. }
  652.  
  653. CMD:ban(playerid, params[])
  654. {
  655.     if (PlayerInfo[playerid][pAdmin] >= 1)
  656.     {
  657.         new target;
  658.         new reason[64];
  659.         new str[128];
  660.         new day,month,year;
  661.         getdate(year, month, day);
  662.         new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
  663.         GetPlayerName(playerid, Adminname, sizeof(Adminname));
  664.         GetPlayerName(target, Playername, sizeof(Playername));
  665.         if(sscanf(params, "us[64]", target,reason)) return SCM(playerid, -1, "[INFO]{FFFFFF}: /ban [playerid] [reason]");
  666.         if(!IsPlayerConnected(target))  return SCM(playerid,Red, "** Player not found.");
  667.         format(str, sizeof(str), "[Adm] %s has been banned by %s. Reason: %s (%d-%d-%d) ", Playername, Adminname, reason,year,month,day);
  668.         SendClientMessageToAll(Red, str);
  669.         printf(str);
  670.         BanLog(str);
  671.         PlayerInfo[target][pBanned] = 1;
  672.         SetTimerEx("bantimer", 1000, false, "d", target);
  673.     }
  674.     else
  675.     {
  676.         SCM(playerid,Red,"Your not admin");
  677.     }
  678.     return 1;
  679. }
  680.  
  681. CMD:kick(playerid, params[])
  682. {
  683.     if (PlayerInfo[playerid][pAdmin] >= 1)
  684.     {
  685.         new target,reason[64],str[128],logstring[200],month,day,year;
  686.         new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
  687.         GetPlayerName(playerid, Adminname, sizeof(Adminname));
  688.         GetPlayerName(target, Playername, sizeof(Playername));
  689.         getdate(year, month, day);
  690.         if(sscanf(params, "us[64]", target,reason)) return SCM(playerid, WHITE, "[INFO]{FFFFFF}: /kick [playerid] [reason]");
  691.         if(!IsPlayerConnected(target))
  692.             return SCM(playerid, WHITE, "Player is not connected!");
  693.         format(str, sizeof(str), "[Adm] %s has been kicked by '%s'. Reason: %s (%d-%d-%d) ", Playername, Adminname, reason,year,month,day);
  694.         printf(str);
  695.         format(logstring, sizeof(logstring), "Info: %s was kicked by %s, reason: %s (%d-%d-%d).",sendername(target),sendername(playerid),reason,year,month,day);
  696.         KickLog(logstring);
  697.         SetTimerEx("kicktimer", 1000, false, "d", target);
  698.  
  699.     }
  700.     else
  701.     {
  702.         SCM(playerid,AztecasColor,"Your not admin");
  703.     }
  704.     return 1;
  705. }
  706.  
  707. CMD:givemoney(playerid, params[])
  708. {
  709.     if (PlayerInfo[playerid][pAdmin] >= 1)
  710.     {
  711.         new string[128],string2[128], targetid, money;
  712.         if(sscanf(params, "ud", targetid, money)) return SCM(playerid,LIGHTBLUE, "[INFO]{FFFFFF}: /givemoney [playerid] [money]");
  713.         if((targetid == INVALID_PLAYER_ID)) return SCM(playerid,Red,"** Player not found.");
  714.         if(IsPlayerConnected(targetid))
  715.         {
  716.             GivePlayerMoney(targetid, money);
  717.             format(string, sizeof(string), "* You have gave %s an amount of $%d.",sendername(targetid),money);
  718.             SCM(playerid,GroveColor, string);
  719.             format(string2,sizeof(string2),"[Money] %s given %s  --> %d.",sendername(playerid),sendername(targetid),money);
  720.             printf(string2);
  721.         }
  722.     }
  723.     else
  724.     {
  725.         SCM(playerid,Red,"Your not admin");
  726.     }
  727.     return 1;
  728. }
  729.  
  730. CMD:setskin(playerid, params[])
  731. {
  732.     if (PlayerInfo[playerid][pAdmin] >= 1)
  733.     {
  734.         new id, skinid, string[128];
  735.         if(sscanf(params, "ui", id, skinid)) return SCM(playerid,Red, " /setskin [playerid] [1-299] ");
  736.         if(skinid < 1 || skinid > 299) return SCM(playerid,Red, "/setskin [playerid] [1-299].");
  737.         if(id == INVALID_PLAYER_ID) return SCM(playerid,Red,"** Player not found.");
  738.         PlayerInfo[id][pSkin] = skinid;
  739.         SetPlayerSkin(id, skinid);
  740.         format(string, 128, "[INFO]{FFFFFF}: Administrator %s has set your skin ID to %i.", sendername(playerid),skinid);
  741.         SCM(id, LIGHTBLUE, string);
  742.         format(string, 128, "[INFO]{FFFFFF}: You have set %s skin ID to %i",sendername(id),skinid);
  743.         SCM(playerid, AztecasColor, string);
  744.     }
  745.     return 1;
  746. }
  747. CMD:gethere(playerid,params[])
  748. {
  749.     if (PlayerInfo[playerid][pAdmin] >= 1)
  750.     {
  751.         new target;
  752.         new string[128],vw;
  753.         if(sscanf(params, "u", target)) return SCM(playerid,LIGHTBLUE, "** /gethere [playerid/partofname].");
  754.         if(!IsPlayerConnected(target)) return SCM(playerid,LIGHTBLUE, "** Player not found.");
  755.         {
  756.             format(string,sizeof string,"** You teleported %s to your location.",sendername(target));
  757.             SCM(playerid,LIGHTBLUE,string);
  758.             new Float:X,Float:Y,Float:Z;
  759.             GetPlayerPos(playerid,X,Y,Z);
  760.             SetPlayerPos(target,X,Y+2,Z);
  761.             SetPlayerVirtualWorld(target,vw);
  762.             SCM(target,LIGHTBLUE,"You have been teleported by an admin.");
  763.         }
  764.     }
  765.     return 1;
  766. }
  767.  
  768. CMD:goto(playerid, params[])
  769. {
  770.     if (PlayerInfo[playerid][pAdmin] >= 1)
  771.     {
  772.         if (PlayerInfo[playerid][pAdmin] >= 1)
  773.         {
  774.             new vw,Float:x,Float:y,Float:z,ID,str[128];
  775.             if(sscanf(params, "u", ID)) return SCM(playerid,LIGHTBLUE, "** /goto [Playerid].");
  776.             if(!IsPlayerConnected(ID)) return SCM(playerid,LIGHTBLUE, "** Player not found.");
  777.             GetPlayerPos(ID, x, y, z);
  778.             vw = GetPlayerVirtualWorld(ID);
  779.             SetPlayerPos(playerid, x+1, y+1, z);
  780.             SetPlayerVirtualWorld(playerid,vw);
  781.             format(str, sizeof(str), "You have been teleported to %s.",sendername(ID));
  782.             SCM(playerid,LIGHTBLUE, str);
  783.             if(IsPlayerInAnyVehicle(playerid))
  784.             {
  785.                 new vid = GetPlayerVehicleID(playerid);
  786.                 GetPlayerPos(ID, x, y, z);
  787.                 SetVehiclePos(vid,x,y,z);
  788.             }
  789.         }
  790.     }
  791.     return 1;
  792. }
  793.  
  794. CMD:setadmin(playerid,params[])
  795. {
  796.  
  797.     if(IsPlayerConnected(playerid))
  798.     {
  799.         if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
  800.         {
  801.  
  802.             new target;
  803.             new level;
  804.             if(sscanf(params,"ui",target,level)) return SCM(playerid, WHITE, "[INFO]{FFFFFF}: /setadmin [Playerid/PartOfName] [level]");
  805.             else if (target == INVALID_PLAYER_ID) return SCM(playerid, WHITE, "[INFO]{FFFFFF}: Player is not connected.");
  806.             {
  807.                 new string[126];
  808.                 PlayerInfo[target][pAdmin] = level;
  809.                 if(level > 1 || level <= 0) return SCM(playerid,Red,"Max admin level is 1");
  810.                 printf("[!] %s has promoted %s to  level %d admin. [!]",sendername(playerid),sendername(target), level);
  811.                 format(string, sizeof(string), " [Adm]  You have been promoted to a level %d admin by %s.", level,sendername(playerid));
  812.                 SCM(target, WHITE, string);
  813.                 format(string, sizeof(string), "[Adm] You have promoted %s to a level %d admin.",sendername(target),level);
  814.                 SCM(playerid, LIGHTBLUE, string);
  815.             }
  816.  
  817.         }
  818.     }
  819.  
  820.     return 1;
  821. }
  822.  
  823. CMD:ahelp(playerid, params[])
  824. {
  825.         if(PlayerInfo[playerid][pAdmin] >= 1)
  826.         SCM(playerid,GroveColor,"Admin commands");
  827.         SCM(playerid,VagosColor,"/jetpack /slap /setscore /repair /ann /ban /kick /givemoney /setadmin /setskin /goto /gethere");
  828.         return 1;
  829. }
  830.  
  831. CMD:report(playerid, params[])
  832. {
  833.  
  834.         new
  835.             targetid,string[256],reason[100];
  836.         if(sscanf(params, "ds[100]", targetid,reason)) return SCM(playerid, Red,"USAGE: /Report [playerid] [reason]");
  837.         format(string,sizeof(string),"REPORT:%s %d has reported %s %d|Reason:%s",GetName(playerid),playerid,GetName(targetid),targetid,reason);
  838.         SendAdminMessage(string);
  839.         SCM(playerid, VagosColor, "Report successfully sended");
  840.         return 1;
  841. }
  842.  
  843. CMD:admins(playerid,params[])
  844. {
  845.  
  846.     if(IsPlayerConnected(playerid))
  847.     {
  848.         SCM(playerid, WHITE, "================================================");
  849.         SCM(playerid, WHITE, "Online Admins:");
  850.         foreach(Player, i)
  851.         {
  852.             if(IsPlayerConnected(i))
  853.             {
  854.                 if(PlayerInfo[i][pAdmin] >= 1)
  855.                 {
  856.                     new admtext[100];
  857.                     new string[100];
  858.                     {
  859.                         if(PlayerInfo[i][pAdmin] >= 6) { admtext = "Owner"; }
  860.                     }
  861.                     format(string, sizeof(string), "(ID %d) %s:%s (Adminlevel: %d)",i,admtext, sendername(i),PlayerInfo[i][pAdmin]);
  862.                     SCM(playerid,-1, string);
  863.                 }
  864.  
  865.             }
  866.         }
  867.         SCM(playerid, WHITE, "================================================");
  868.     }
  869.  
  870.     return 1;
  871. }
  872. CMD:pm(playerid, params[])
  873. {
  874.     new str[100], str2[100], id;
  875.     if(sscanf(params, "us", id, str2))
  876.     {
  877.         SCM(playerid, WHITE, "Error: /PM [playerid] [message]");
  878.         return 1;
  879.     }
  880.     if(apm == 0)
  881.     {
  882.         if(!IsPlayerConnected(id)) return SCM(playerid, WHITE, "[INFO]{FFFFFF}:Player is not connected.");
  883.         {
  884.             format(str, sizeof(str), "(( PM to %s[%d]: %s  ))", sendername(id), id, str2);
  885.             SCM(playerid,PINK, str);
  886.             format(str, sizeof(str), " (( PM from %s[%d]: %s ))", sendername(playerid), playerid, str2);
  887.             SCM(id,PINK, str);
  888.         }
  889.     } else { SCM(playerid,VagosColor,"** Private Messages are currently disabled!"); }
  890.     return 1;
  891. }
  892.  
  893. CMD:rules(playerid, params[])
  894. {
  895. SendClientMessage(playerid, AztecasColor, "Rules");
  896. SendClientMessage(playerid, Orange, "1.Do not Ram!");
  897. SendClientMessage(playerid, Orange, "2.Do not Death Evade!");
  898. SendClientMessage(playerid, Orange, "3.hacks/mods not allowed!");
  899. SendClientMessage(playerid, Orange, "5.Respect all players/admins!");
  900. SendClientMessage(playerid, Orange, "6.C-Bug SlideBug DoubleBug are allowed!");
  901. SendClientMessage(playerid, Orange, "7.Do not ask for admin but you can make a admin application");
  902. return true;
  903. }
  904.  
  905. CMD:kill(playerid, params[]) {
  906.  
  907.     SetPlayerHealth(playerid,0);
  908.     SendClientMessage(playerid, 0x33AA33AA, "you killed ur self");
  909.     return 1;
  910. }
  911. CMD:spawn(playerid, params[]) {
  912.  
  913.     SpawnPlayer(playerid);
  914.     SendClientMessage(playerid, 0x33AA33AA, "your spawned");
  915.     return 1;
  916. }
  917. CMD:gang(playerid, params[])
  918. {
  919.     SetPlayerHealth(playerid,0);
  920.     ForceClassSelection(playerid);
  921.     return 1;
  922. }
  923.  
  924. CMD:nitro(playerid, params[])
  925. {
  926.         if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xff0000ff,"You must be in a vehicle!");
  927.         AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
  928.         SendClientMessage(playerid,GroveColor,"Nitro added!");
  929.         return 1;
  930. }
  931.  
  932. CMD:help(playerid, params[])
  933. {
  934.         SCM(playerid,GroveColor,"Player commands");
  935.         SCM(playerid,VagosColor,"/report /admins /pm /rules /nitro /gang /spawn /kill");
  936.         return 1;
  937. }
  938. //===============================[The End]====================================//
Advertisement
Add Comment
Please, Sign In to add comment