Advertisement
Guest User

[Matnix] Gang wars - basic scripts

a guest
Aug 13th, 2013
2,980
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 20.43 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2.                     ,---.                 ,.   ,   ,.
  3.                     |  -'  ,-. ,-. ,-.    `|  /|  / ,-. ,-.
  4.                     |  ,-' ,-| | | | |     | / | /  ,-| |
  5.                     `---|  `-^ ' ' `-|     `'  `'   `-^ '
  6.                      ,-.|           ,| basic, simple, start with this one.
  7.                      `-+'           `'
  8. -------------------------------------------------------------------------------*/
  9. #include <a_samp>
  10. //#include "../include/gl_common.inc"
  11. //------------------------------------------------------------------------------
  12.  
  13. //------------------------------------------------------------------------------
  14. new rconAttempts[MAX_PLAYERS];
  15. //------------------------------------------------------------------------------
  16.  
  17. //------------------------------------------------------------------------------
  18. new gTeam[MAX_PLAYERS];
  19. //------------------------------------------------------------------------------
  20.  
  21. //------------------------------------------------------------------------------
  22. new SpamCheck[MAX_PLAYERS];
  23. new FloodCheck[MAX_PLAYERS];
  24. //------------------------------------------------------------------------------
  25.  
  26. //------------------------------------------------------------------------------
  27. //new total_vehicles_from_files=0;
  28. //------------------------------------------------------------------------------
  29.  
  30. //------------------------------------------------------------------------------
  31. new Text:Textdraw50,
  32.     Text:Textdraw51,
  33.     Text:Textdraw52,
  34.     Text:Textdraw53,
  35.     Text:Textdraw54;
  36. new Dead[MAX_PLAYERS], Killedby[MAX_PLAYERS];
  37. //------------------------------------------------------------------------------
  38.  
  39. //------------------------------------------------------------------------------
  40. #define BLANC                                                         0xFFFFFFC8
  41. //------------------------------------------------------------------------------
  42.  
  43. //------------------------------------------------------------------------------
  44. #define TEAM_GROVE 0
  45. #define TEAM_BALLAS 1
  46. #define TEAM_VAGOS 2
  47. #define TEAM_AZTECAS 3
  48. #define TEAM_COPS 4
  49. #define MAX_TEAMS 5
  50. //------------------------------------------------------------------------------
  51.  
  52. //------------------------------------------------------------------------------
  53. new Float:gRandomSpawns[][] = //Grove
  54. {
  55.     {2508.1748,-1684.6676,13.5584},
  56.     {2498.8030,-1645.4890,13.5380},
  57.     {2489.9597,-1647.0461,14.0772},
  58.     {2459.4673,-1689.3765,13.5363}
  59. };
  60. new Float:bRandomSpawns[][] = //Ballas
  61. {
  62.     {2092.3215,-1145.3455,25.5860},
  63.     {2143.6028,-1172.0547,23.9922},
  64.     {2153.8694,-1241.7596,25.2327}
  65. };
  66. new Float:cRandomSpawns[][] = //Cops
  67. {
  68.     {1547.8885,-1669.1351,13.5666},
  69.     {1577.2594,-1636.5551,13.5618},
  70.     {1565.9746,-1694.1029,5.89060},
  71.     {1546.6296,-1682.0840,13.5583}
  72. };
  73. new Float:vRandomSpawns[][] = //Vagos
  74. {
  75.     {2347.6423,-1168.7085,27.9883},
  76.     {2319.0576,-1168.7308,27.7298},
  77.     {2359.5972,-1170.6938,28.0039},
  78.     {2373.6902,-1141.2670,28.4669}
  79. };
  80. new Float:aRandomSpawns[][] = //Aztecas
  81. {
  82.     {1894.1813,-2030.4396,13.5469},
  83.     {1871.8584,-2030.2926,13.5469},
  84.     {1883.2733,-2011.0006,13.5469},
  85.     {1896.0953,-2037.8591,13.5469}
  86. };
  87. //------------------------------------------------------------------------------
  88.  
  89. //------------------------------------------------------------------------------
  90. new randomMessages[][] =
  91. {
  92.     "Gamemode : place your random message @line 92",
  93.     "Gamemode : place your random message @line 93",
  94.     "Gamemode : place your random message @line 94"
  95. };
  96. //------------------------------------------------------------------------------
  97.  
  98. //------------------------------------------------------------------------------
  99. main()
  100. {
  101.     print("\n-------------------------------------------------------------------");
  102.     print("                 Matnix basics Gang-War Script                       ");
  103.     print("-------------------------------------------------------------------\n");
  104. }
  105. //------------------------------------------------------------------------------
  106.  
  107. //------------------------------------------------------------------------------
  108. public OnGameModeInit()
  109. {
  110.     SetGameModeText("GangWar-Base");
  111.     UsePlayerPedAnims();
  112. //-----------------------------------------------------------------------[GROVE]
  113.     AddPlayerClass(105,0,0,0,0,0,0,0,0,0,0);
  114.     AddPlayerClass(106,0,0,0,0,0,0,0,0,0,0);
  115.     AddPlayerClass(107,0,0,0,0,0,0,0,0,0,0);
  116.     AddPlayerClass(195,0,0,0,0,0,0,0,0,0,0);
  117. //----------------------------------------------------------------------[AZTECA]
  118.     AddPlayerClass(114,0,0,0,0,0,0,0,0,0,0);
  119.     AddPlayerClass(115,0,0,0,0,0,0,0,0,0,0);
  120.     AddPlayerClass(116,0,0,0,0,0,0,0,0,0,0);
  121. //------------------------------------------------------------------------[COPS]
  122.     AddPlayerClass(280,0,0,0,0,0,0,0,0,0,0);
  123.     AddPlayerClass(284,0,0,0,0,0,0,0,0,0,0);
  124.     AddPlayerClass(285,0,0,0,0,0,0,0,0,0,0);
  125. //----------------------------------------------------------------------[BALLAS]
  126.     AddPlayerClass(102,0,0,0,0,0,0,0,0,0,0);
  127.     AddPlayerClass(103,0,0,0,0,0,0,0,0,0,0);
  128.     AddPlayerClass(104,0,0,0,0,0,0,0,0,0,0);
  129.     AddPlayerClass(13,0,0,0,0,0,0,0,0,0,0);
  130. //-----------------------------------------------------------------------[VAGOS]
  131.     AddPlayerClass(108,0,0,0,0,0,0,0,0,0,0);
  132.     AddPlayerClass(109,0,0,0,0,0,0,0,0,0,0);
  133.     AddPlayerClass(110,0,0,0,0,0,0,0,0,0,0);
  134. //------------------------------------------------------------------------------
  135. /*==============================================================================
  136.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
  137.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  138.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  139.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  140. ===============================================================================*/
  141. //------------------------------------------------------------------------------
  142.     Textdraw50 = TextDrawCreate(0.000000, 0.000000, "LD_SPAC:white");           // Kill-cam (by Matnix)
  143.     TextDrawLetterSize(Textdraw50, 0.000000, 0.000000);
  144.     TextDrawTextSize(Textdraw50, 640.000000, 59.920001);
  145.     TextDrawAlignment(Textdraw50, 1);
  146.     TextDrawColor(Textdraw50, 255);
  147.     TextDrawSetShadow(Textdraw50, 0);
  148.     TextDrawSetOutline(Textdraw50, 0);
  149.     TextDrawFont(Textdraw50, 4);
  150.     Textdraw51 = TextDrawCreate(641.500000, 61.420001, "usebox");
  151.     TextDrawLetterSize(Textdraw51, 0.000000, 42.741107);
  152.     TextDrawTextSize(Textdraw51, -2.000000, 0.000000);
  153.     TextDrawAlignment(Textdraw51, 1);
  154.     TextDrawColor(Textdraw51, 0);
  155.     TextDrawUseBox(Textdraw51, true);
  156.     TextDrawBoxColor(Textdraw51, 102);
  157.     TextDrawSetShadow(Textdraw51, 0);
  158.     TextDrawSetOutline(Textdraw51, 0);
  159.     TextDrawFont(Textdraw51, 0);
  160.     Textdraw52 = TextDrawCreate(0.000000, 423.920013, "LD_SPAC:white");
  161.     TextDrawLetterSize(Textdraw52, 0.000000, 0.000000);
  162.     TextDrawTextSize(Textdraw52, 640.000000, 19.600006);
  163.     TextDrawAlignment(Textdraw52, 1);
  164.     TextDrawColor(Textdraw52, 255);
  165.     TextDrawSetShadow(Textdraw52, 0);
  166.     TextDrawSetOutline(Textdraw52, 0);
  167.     TextDrawFont(Textdraw52, 4);
  168.     Textdraw53 = TextDrawCreate(246.000000, 11.760004, "KILL - CAM");
  169.     TextDrawLetterSize(Textdraw53, 0.784999, 3.644000);
  170.     TextDrawAlignment(Textdraw53, 1);
  171.     TextDrawColor(Textdraw53, -1378294017);
  172.     TextDrawSetShadow(Textdraw53, 0);
  173.     TextDrawSetOutline(Textdraw53, 1);
  174.     TextDrawBackgroundColor(Textdraw53, 51);
  175.     TextDrawFont(Textdraw53, 3);
  176.     TextDrawSetProportional(Textdraw53, 1);
  177.     Textdraw54 = TextDrawCreate(54.500000, 425.599914, "Spawn in five seconds.");
  178.     TextDrawLetterSize(Textdraw54, 0.350500, 1.488000);
  179.     TextDrawAlignment(Textdraw54, 1);
  180.     TextDrawColor(Textdraw54, -1378294017);
  181.     TextDrawSetShadow(Textdraw54, 0);
  182.     TextDrawSetOutline(Textdraw54, 1);
  183.     TextDrawBackgroundColor(Textdraw54, 51);
  184.     TextDrawFont(Textdraw54, 1);
  185.     TextDrawSetProportional(Textdraw54, 1);
  186.     SetTimer("RandomMessage",180000,1); // each 3min
  187.     return 1;
  188. }
  189. //------------------------------------------------------------------------------
  190.  
  191. //------------------------------------------------------------------------------
  192. public OnGameModeExit()
  193. {
  194.     return 1;
  195. }
  196. //------------------------------------------------------------------------------
  197.  
  198. //------------------------------------------------------------------------------
  199. public OnPlayerRequestClass(playerid, classid)
  200. {
  201.     SetPlayerCameraPos(playerid, 207.1526, -39.3834, 1002.8735);
  202.     SetPlayerCameraLookAt(playerid, 207.5223, -38.4558, 1002.6689);
  203.     SetPlayerPos(playerid,209.20, -34.24, 1001.93);
  204.     SetPlayerFacingAngle(playerid, 180.0);
  205.     SetPlayerInterior(playerid,1);
  206.     SetPlayerTeamFromClass(playerid, classid);
  207.     switch (classid)
  208.     {
  209.         case 0,1,2,3://GROVE
  210.         {
  211.             if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
  212.             {
  213.                 GameTextForPlayer(playerid,"~g~Grove",800,6);
  214.             }
  215.         }
  216.         case 4,5,6://AZTECA
  217.         {
  218.             if(classid == 4 || classid == 5 || classid == 6)
  219.             {
  220.                 GameTextForPlayer(playerid,"~b~Azteca",800,6);
  221.             }
  222.         }
  223.         case 7,8,9://COPS
  224.         {
  225.             if(classid == 7 || classid == 8 || classid == 9)
  226.             {
  227.                 GameTextForPlayer(playerid,"~b~Police",800,6);
  228.             }
  229.         }
  230.         case 10,11,12,13://BALLAS
  231.         {
  232.             if(classid == 10 || classid == 11 || classid == 12 || classid == 13)
  233.             {
  234.                 GameTextForPlayer(playerid,"~p~Ballas",800,6);
  235.             }
  236.         }
  237.         case 14,15,16://VAGOS
  238.         {
  239.             if(classid == 14 || classid == 15 || classid == 16)
  240.             {
  241.                 GameTextForPlayer(playerid,"~y~Vagos",800,6);
  242.             }
  243.         }
  244.     }
  245.     return 1;
  246. }
  247. //------------------------------------------------------------------------------
  248.  
  249. //------------------------------------------------------------------------------
  250. SetPlayerTeamFromClass(playerid, classid)
  251. {
  252.     ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0,0,0,0,0,0);
  253.     if (classid == 0 ||classid == 1 ||classid == 2 ||classid == 3)
  254.     {
  255.         gTeam[playerid] = TEAM_GROVE;
  256.     }
  257.     else if(classid == 4 ||classid == 5 ||classid == 6)
  258.     {
  259.         gTeam[playerid] = TEAM_AZTECAS;
  260.     }
  261.     else if(classid == 7 ||classid == 8 ||classid == 9)
  262.     {
  263.         gTeam[playerid] = TEAM_COPS;
  264.     }
  265.     else if(classid == 10 ||classid == 11 ||classid == 12 ||classid == 13)
  266.     {
  267.         gTeam[playerid] = TEAM_BALLAS;
  268.     }
  269.     else if(classid == 14 ||classid == 15 ||classid == 16)
  270.     {
  271.         gTeam[playerid] = TEAM_VAGOS;
  272.     }
  273.     return 1;
  274. }
  275. //------------------------------------------------------------------------------
  276.  
  277. //------------------------------------------------------------------------------
  278. public OnPlayerConnect(playerid)
  279. {
  280.     return 1;
  281. }
  282. //------------------------------------------------------------------------------
  283.  
  284. //------------------------------------------------------------------------------
  285. public OnPlayerText(playerid, text[])
  286. {
  287.     new string[256], Nom[MAX_PLAYER_NAME];
  288.     GetPlayerName(playerid, Nom, sizeof (Nom));
  289.     if(text[0] == '!') // !TEXT private gang.
  290.     {
  291.         for(new i; i < MAX_PLAYERS; i++)
  292.         {
  293.             if(gTeam[playerid] == gTeam[i])
  294.             {
  295.                 format(string,sizeof(string),"[New Gang Message] (%s) said : %s", Nom,text[1]);
  296.                 SendClientMessage(i,0x7fff00FF,string);
  297.             }
  298.         }
  299.         return 0;
  300.     }
  301.     if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
  302.     {
  303.         SendClientMessage(playerid,BLANC,"Anti-Spam TEXT");
  304.         return 0;
  305.     }
  306.     FloodCheck[playerid] = GetTickCount();
  307.     if(gTeam[playerid] == TEAM_GROVE)
  308.     {
  309.         format(string,sizeof(string), "{80F547}Grove{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
  310.         SendClientMessageToAll(-1, string);
  311.         return 0;
  312.     }
  313.     else if(gTeam[playerid] == TEAM_BALLAS)
  314.     {
  315.         format(string,sizeof(string), "{9A35FF}Ballas{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
  316.         SendClientMessageToAll(-1, string);
  317.         return 0;
  318.     }
  319.     else if(gTeam[playerid] == TEAM_VAGOS)
  320.     {
  321.         format(string,sizeof(string), "{FECD38}Vagos{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
  322.         SendClientMessageToAll(-1, string);
  323.         return 0;
  324.     }
  325.     else if(gTeam[playerid] == TEAM_AZTECAS)
  326.     {
  327.         format(string,sizeof(string), "{0DFFFF}Aztecas{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
  328.         SendClientMessageToAll(-1, string);
  329.         return 0;
  330.     }
  331.     else if(gTeam[playerid] == TEAM_COPS)
  332.     {
  333.         format(string,sizeof(string), "{42C1FF}Cops{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
  334.         SendClientMessageToAll(-1, string);
  335.         return 0;
  336.     }
  337.     return 1;
  338. }
  339. public OnPlayerDisconnect(playerid, reason)
  340. {
  341.     return 1;
  342. }
  343.  
  344. //------------------------------------------------------------------------------
  345.  
  346. //------------------------------------------------------------------------------
  347. public OnPlayerSpawn(playerid)
  348. {
  349.     SetPlayerHealth(playerid, 9999);
  350.     SetTimer("AntiSpawnkill", 5000,1); // change it to your seconds mine is (5) 5000ms = 5scd
  351.     if(gTeam[playerid] == TEAM_GROVE)
  352.     {
  353.         GivePlayerWeapon(playerid, 24, 150), GivePlayerWeapon(playerid, 27, 200),
  354.         GivePlayerWeapon(playerid, 31, 400), GivePlayerWeapon(playerid, 32, 300),
  355.         GivePlayerWeapon(playerid, 16, 5);
  356.         new rand = random(sizeof(gRandomSpawns));
  357.         SetPlayerPos(playerid, gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);
  358.         SetPlayerInterior(playerid, 0);
  359.         SetPlayerColor(playerid, 0x2291FF90);
  360.         return 1;
  361.     }
  362.     if(gTeam[playerid] == TEAM_BALLAS)
  363.     {
  364.         GivePlayerWeapon(playerid, 24, 200), GivePlayerWeapon(playerid, 25, 300),
  365.         GivePlayerWeapon(playerid, 34, 50), GivePlayerWeapon(playerid, 18, 5),
  366.         GivePlayerWeapon(playerid, 28, 400);
  367.         new rand = random(sizeof(bRandomSpawns));
  368.         SetPlayerPos(playerid, bRandomSpawns[rand][0], bRandomSpawns[rand][1], bRandomSpawns[rand][2]);
  369.         SetPlayerInterior(playerid, 0);
  370.         SetPlayerColor(playerid, 0x9A35FF90);
  371.         return 1;
  372.     }
  373.     if(gTeam[playerid] == TEAM_VAGOS)
  374.     {
  375.         GivePlayerWeapon(playerid, 24, 200), GivePlayerWeapon(playerid, 26, 210),
  376.         GivePlayerWeapon(playerid, 33, 50), GivePlayerWeapon(playerid, 18, 5);
  377.         new rand = random(sizeof(vRandomSpawns));
  378.         SetPlayerPos(playerid, vRandomSpawns[rand][0], vRandomSpawns[rand][1], vRandomSpawns[rand][2]);
  379.         SetPlayerInterior(playerid, 0);
  380.         SetPlayerColor(playerid, 0xE1C41E90);
  381.         return 1;
  382.     }
  383.     if(gTeam[playerid] == TEAM_AZTECAS)
  384.     {
  385.         GivePlayerWeapon(playerid, 22, 250), GivePlayerWeapon(playerid, 26, 210),
  386.         GivePlayerWeapon(playerid, 29, 300), GivePlayerWeapon(playerid, 34, 50),
  387.         GivePlayerWeapon(playerid, 16, 5);
  388.         new rand = random(sizeof(aRandomSpawns));
  389.         SetPlayerPos(playerid, aRandomSpawns[rand][0], aRandomSpawns[rand][1], aRandomSpawns[rand][2]);
  390.         SetPlayerInterior(playerid, 0);
  391.         SetPlayerColor(playerid, 0x05C5E790);
  392.         return 1;
  393.     }
  394.     if(gTeam[playerid] == TEAM_COPS)
  395.     {
  396.         GivePlayerWeapon(playerid, 22, 250), GivePlayerWeapon(playerid, 25, 200),
  397.         GivePlayerWeapon(playerid, 29, 300), GivePlayerWeapon(playerid, 31, 300),
  398.         GivePlayerWeapon(playerid, 16, 5);
  399.         new rand = random(sizeof(cRandomSpawns));
  400.         SetPlayerPos(playerid, cRandomSpawns[rand][0], cRandomSpawns[rand][1], cRandomSpawns[rand][2]);
  401.         SetPlayerInterior(playerid, 0);
  402.         SetPlayerColor(playerid, 0x2291FF90);
  403.         return 1;
  404.     }
  405.     return 1;
  406. }
  407. //------------------------------------------------------------------------------
  408.  
  409. //------------------------------------------------------------------------------
  410. public OnPlayerDeath(playerid, killerid, reason)
  411. {
  412.     SetPlayerScore(killerid,GetPlayerScore(playerid)+1);
  413.     GivePlayerMoney(killerid, 500);
  414.     GivePlayerMoney(playerid, -50);
  415.     SendDeathMessage(killerid,playerid,reason);
  416.     Dead[playerid] = 1;
  417.     if(Dead[playerid] == 1)
  418.     {
  419.         Dead[playerid] = 0;
  420.         if(Killedby[playerid] != INVALID_PLAYER_ID)
  421.         TogglePlayerSpectating(playerid, 1);
  422.         PlayerSpectatePlayer(playerid, killerid);
  423.         TextDrawShowForPlayer(playerid, Textdraw50), TextDrawShowForPlayer(playerid, Textdraw51),
  424.         TextDrawShowForPlayer(playerid, Textdraw52), TextDrawShowForPlayer(playerid, Textdraw53),
  425.         TextDrawShowForPlayer(playerid, Textdraw54);
  426.         SetTimerEx("KillCam", 5000, false, "i", playerid);
  427.     }
  428.     else
  429.     {
  430.         TogglePlayerSpectating(playerid, 0);
  431.     }
  432.     return 1;
  433. }
  434. //------------------------------------------------------------------------------
  435.  
  436. //------------------------------------------------------------------------------
  437. public OnPlayerCommandText(playerid, cmdtext[])
  438. {
  439.     if(GetTickCount() - SpamCheck[playerid] < 10000 && SpamCheck[playerid] != 0)
  440.     {
  441.         SendClientMessage(playerid,BLANC,"Anti-Commands SPAMN");
  442.         return 1;
  443.     }
  444.     if (strcmp("/yourcmds", cmdtext, true, 10) == 0)
  445.     {
  446.         SpamCheck[playerid] = GetTickCount(); //anti-commands-spam
  447.         // if he spam this commands he will get the message "Anti-Commands SPAM"
  448.         return 1;
  449.     }
  450.     return 0;
  451. }
  452. //------------------------------------------------------------------------------
  453.  
  454. //------------------------------------------------------------------------------
  455. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  456. {
  457. // antiteamkill_
  458.     new Float:Health;
  459.     GetPlayerHealth(playerid, Health);
  460.     if(gTeam[issuerid] == gTeam[playerid])
  461.     {
  462.         GetPlayerHealth(playerid, Health);
  463.         SetPlayerHealth(playerid, Health+amount);
  464.     }
  465. // damageinfo_
  466.     if(issuerid != INVALID_PLAYER_ID)
  467.     {
  468.         new string[128];
  469.         format(string, sizeof(string), "~b~+%.0f ~w~dammage", amount);
  470.         GameTextForPlayer(issuerid, string, 5000, 1);
  471.         PlayerPlaySound(issuerid, 1057, 0.0, 0.0, 0.0);
  472.  
  473.         format(string, sizeof(string), "~r~-%.0f ~w~dammage", amount);
  474.         GameTextForPlayer(playerid, string, 5000, 1);
  475.         PlayerPlaySound(playerid, 4203, 0.0, 0.0, 0.0);
  476.     }
  477.     return 1;
  478. }
  479. //------------------------------------------------------------------------------
  480.  
  481. //------------------------------------------------------------------------------
  482. public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
  483. {
  484.     new veh = GetPlayerVehicleID(playerid);
  485.     new Float:x,Float:y,Float:z = GetPlayerPos(playerid,x,y,z);
  486.     SetPlayerArmedWeapon(playerid, 0);
  487.     for(new i;i<MAX_PLAYERS<i++;)
  488.     {
  489.         if(IsPlayerInVehicle(i,veh) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
  490.         {
  491.             if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
  492.             {
  493.                 SetPlayerPos(playerid,x,y,z+2);
  494.                 GameTextForPlayer(playerid,"~r~ANTI-TEAM JACK", 2000,4);
  495.             }
  496.         }
  497.     }
  498.     return 1;
  499. }
  500. //------------------------------------------------------------------------------
  501.  
  502. //------------------------------------------------------------------------------
  503. public OnRconLoginAttempt(ip[], password[], success)
  504. {
  505.     if(!success)
  506.     {
  507.         new playersIP[17], playerid;
  508.         for(; playerid < MAX_PLAYERS; playerid++)
  509.         {
  510.             GetPlayerIp(playerid, playersIP, 17);
  511.             if(!strcmp(ip, playersIP))
  512.             {
  513.                 break;
  514.             }
  515.         }
  516.         rconAttempts[playerid]++;
  517.         if(rconAttempts[playerid] >= 2)
  518.         {
  519.             Ban(playerid);
  520.         }
  521.     }
  522.     return 1;
  523. }
  524. //------------------------------------------------------------------------------
  525.  
  526. //------------------------------------------------------------------------------
  527. forward KillCam(playerid);
  528. public KillCam(playerid)
  529. {
  530.     TogglePlayerSpectating(playerid, 0);
  531.     TextDrawHideForPlayer(playerid, Textdraw50), TextDrawHideForPlayer(playerid, Textdraw51),
  532.     TextDrawHideForPlayer(playerid, Textdraw52), TextDrawHideForPlayer(playerid, Textdraw53),
  533.     TextDrawHideForPlayer(playerid, Textdraw54);
  534. }
  535. //------------------------------------------------------------------------------
  536.  
  537. //------------------------------------------------------------------------------
  538. forward AntiSpawnkill(playerid);
  539. public AntiSpawnkill(playerid)
  540. {
  541.     SetPlayerHealth(playerid, 100.0);
  542.     return 1;
  543. }
  544. //------------------------------------------------------------------------------
  545.  
  546. //------------------------------------------------------------------------------
  547. forward RandomMessage();
  548. public RandomMessage()
  549. {
  550.     new randomMsg = random(sizeof(randomMessages));
  551.     SendClientMessageToAll(BLANC, randomMessages[randomMsg]);
  552.     return 1;
  553. }
  554. //------------------------------------------------------------------------------
  555.  
  556. //------------------------------------------------------------------------------
  557. stock IsPlayerFlooding(playerid)
  558. {
  559.     if(GetTickCount() - FloodCheck[playerid] < 2000)
  560.             return 1;
  561.     return 0;
  562. }
  563. //------------------------------------------------------------------------------
  564.  
  565. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement