Advertisement
Raminkh78

PaintBall System

Sep 14th, 2015
1,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.08 KB | None | 0 0
  1. /*
  2.     †††††††††††††††† [Paint Ball System] ††††††††††††††††
  3.     Good Luck With It !
  4.     ***********************************
  5.     ***    Created By [R]amin_       **
  6.     ***    khramin78@gmail.com       **
  7.     ***    Mobin.dfer@yahoo.com      **
  8.     ***********************************
  9.      Used For RP Server's Or Maybe Deathmatch Server's Too
  10.     †††††††††††††††† [Paint Ball System] ††††††††††††††††
  11. */
  12.  
  13. #include <a_samp>
  14. #include <sscanf2>
  15. #include <Zcmd>
  16.  
  17. #define COLOR_RED 0xAA3333AA
  18. #define COLOR_LIGHTRED 0xFF6347AA
  19. #define COLOR_LIGHTBLUE 0x33CCFFAA
  20. #define COLOR_YELLOW 0xFFFF00AA
  21. #define COLOR_WHITE 0xFFFFFFAA
  22.  
  23. #define COL_WHITE "{FFFFFF}"
  24. #define COL_RED "{F81414}"
  25. #define COL_YELLOW "{F3FF02}"
  26. #define COL_LRED "{FFA1A1}"
  27.  
  28. #define Dialog_Paintball 1101
  29.  
  30. #define FILTERSCRIPT
  31.  
  32. #if defined FILTERSCRIPT
  33.  
  34. public OnFilterScriptInit()
  35. {
  36.     print("\n--------------------------------------");
  37.     print(" This FilterScript Has Been Made By [R]amin_");
  38.     print(" Conntect me on :");
  39.     print(" khramin78@gmail.com");
  40.     print(" mobin.dfer@yahoo.com");
  41.     print("--------------------------------------\n");
  42.  
  43.     CreatePickup(1239,1,1310.1099,-1367.9067,13.5421,-1);
  44.     Create3DTextLabel("Paint Ball : /enter to Join",COLOR_YELLOW,1310.1099,-1367.9067,13.5421,10,0,0);
  45.    
  46.     return 1;
  47. }
  48.  
  49. public OnFilterScriptExit()
  50. {
  51.     return 1;
  52. }
  53.  
  54. #endif
  55.  
  56. forward PaintBallStarting(playerid);
  57. forward PaintBallStart(playerid);
  58. forward PaintBallEnd(playerid);
  59.  
  60. new DeagleVote;
  61. new ShotgunVote;
  62. new M4Vote;
  63. new Mp5Vote;
  64. new SnipeVote;
  65. new PlayerPBKills[MAX_PLAYERS];
  66. new bool:PlayerPBing[MAX_PLAYERS];
  67. new PBLeaderid = 999;
  68. new PBLeaderKills = 0;
  69. new PBPlayers = 0;
  70. new PBGunID;
  71. new bool:PBStarted;
  72.  
  73. new PBSkins[] =
  74. {
  75.     137,
  76.     181,
  77.     212
  78. };
  79.  
  80. new Float:PBSpawns[][] =
  81. {
  82.     {-348.1376,2222.3022,42.4912,0.5975}, // Spawn 1
  83.     {-366.0266,2263.8604,42.5641,271.2900}, // Spawn 2
  84.     {-431.7350,2240.2869,42.9834,178.7918}, // Spawn 3
  85.     {-452.6353,2217.8867,42.4297,189.6790}, // spawn 4
  86.     {-392.8849,2198.0518,42.4245,189.0656} // spawn
  87. };
  88.  
  89. public OnPlayerConnect(playerid)
  90. {
  91.     SetPlayerMapIcon(playerid,0,1310.1099,-1367.9067,13.5421,18,-1,0);
  92.     PlayerPBing[playerid] = false;
  93.     PlayerPBKills[playerid] = 0;
  94.     return 1;
  95. }
  96.  
  97. public OnPlayerDisconnect(playerid, reason)
  98. {
  99.     if(PlayerPBing[playerid] == true)
  100.     {
  101.         PBPlayers--;
  102.     }
  103.     return 1;
  104. }
  105.  
  106. public OnPlayerSpawn(playerid)
  107. {
  108.     if(PlayerPBing[playerid] == true)
  109.     {
  110.         new RandomSpawn = random(sizeof(PBSpawns));
  111.         new RandomSkins = random(sizeof(PBSkins));
  112.         SetPlayerSkin(playerid,PBSkins[RandomSkins]);
  113.         SetPlayerPos(playerid,PBSpawns[RandomSpawn][0],PBSpawns[RandomSpawn][1],PBSpawns[RandomSpawn][2]);
  114.         SetPlayerFacingAngle(playerid,PBSpawns[RandomSpawn][3]);
  115.         SetPlayerHealth(playerid,100.0);
  116.         SetPlayerArmour(playerid,50.0);
  117.         ResetPlayerWeapons(playerid);
  118.         GivePlayerWeapon(playerid,PBGunID,99999);
  119.     }
  120.     return 1;
  121. }
  122.  
  123. public OnPlayerDeath(playerid, killerid, reason)
  124. {
  125.     if(PlayerPBing[killerid] == true)
  126.     {
  127.         new string[128],pName[MAX_PLAYER_NAME];
  128.         GetPlayerName(killerid,pName,sizeof(pName));
  129.         PlayerPBKills[killerid]++;
  130.         if(PlayerPBKills[killerid] > PBLeaderKills)
  131.         {
  132.             PBLeaderKills = PlayerPBKills[killerid];
  133.             PBLeaderid = killerid;
  134.             format(string,sizeof(string),"The Player "COL_RED"%s(%d) "COL_WHITE"Is In Lead With "COL_RED"%d "COL_WHITE"Kills",pName,killerid,PlayerPBKills[killerid]);
  135.             for(new i = 0; i < MAX_PLAYERS; i++)
  136.             {
  137.                 if(PlayerPBing[i] == true)
  138.                 {
  139.                     SendClientMessage(i,COLOR_WHITE,string);
  140.                 }
  141.             }
  142.         }
  143.     }
  144.     return 1;
  145. }
  146.  
  147.  
  148. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  149. {
  150.     if(dialogid == Dialog_Paintball)
  151.     {
  152.         switch(listitem)
  153.         {
  154.             case 0:
  155.             {
  156.                 SendClientMessage(playerid,COLOR_YELLOW,"you Have Voted Deagle sucsessfully !");
  157.                 DeagleVote++;
  158.                 SetTimer("PaintBallStarting",100,false);
  159.             }
  160.             case 1:
  161.             {
  162.                 SendClientMessage(playerid,COLOR_YELLOW,"you Have Voted Shotgun sucsessfully !");
  163.                 ShotgunVote++;
  164.                 SetTimer("PaintBallStarting",100,false);
  165.             }
  166.             case 2:
  167.             {
  168.                 SendClientMessage(playerid,COLOR_YELLOW,"you Have Voted M4 sucsessfully !");
  169.                 M4Vote++;
  170.                 SetTimer("PPaintBallStarting",100,false);
  171.             }
  172.             case 3:
  173.             {
  174.                 SendClientMessage(playerid,COLOR_YELLOW,"you Have Voted Mp5 sucsessfully !");
  175.                 Mp5Vote++;
  176.                 SetTimer("PaintBallStarting",100,false);
  177.             }
  178.             case 4:
  179.             {
  180.                 SendClientMessage(playerid,COLOR_YELLOW,"you Have Voted Snipe sucsessfully !");
  181.                 SnipeVote++;
  182.                 SetTimer("PaintBallStarting",100,false);
  183.             }
  184.         }
  185.     }
  186.     return 0;
  187. }
  188. public PaintBallStarting(playerid)
  189. {
  190.         new string[128];
  191.         format(string,sizeof(string),"A PaintBall Match Is Going To Start You Have 30 Second's To Join This Match (Current Player's : %d)",PBPlayers);
  192.         SendClientMessageToAll(COLOR_LIGHTBLUE,string);
  193.         SetTimer("PaintBallStart",30000,false);
  194. }
  195. public PaintBallStart(playerid)
  196. {
  197.     PBStarted = true;
  198.     SendClientMessageToAll(COLOR_LIGHTBLUE,"PaintBall Match Has Been Started You Can Not Join Now");
  199.     if(PlayerPBing[playerid] == true)
  200.     {
  201.         if(DeagleVote > ShotgunVote && DeagleVote > M4Vote && DeagleVote > Mp5Vote && DeagleVote > SnipeVote )
  202.         {
  203.             ResetPlayerWeapons(playerid);
  204.             GivePlayerWeapon(playerid,24,99999);
  205.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Has Been Started With Gun Deagle");
  206.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Will Be End In 3 Min's");
  207.             TogglePlayerControllable(playerid,1);
  208.             PBGunID = 24;
  209.             SetTimer("PaintBallEnd",180000,false);
  210.         }
  211.         if(ShotgunVote > DeagleVote && ShotgunVote > M4Vote && ShotgunVote > Mp5Vote && ShotgunVote > SnipeVote )
  212.         {
  213.             ResetPlayerWeapons(playerid);
  214.             GivePlayerWeapon(playerid,25,99999);
  215.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Has Been Started With Gun Shotgun");
  216.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Will Be End In 3 Min's");
  217.             TogglePlayerControllable(playerid,1);
  218.             PBGunID = 25;
  219.             SetTimer("PaintBallEnd",180000,false);
  220.         }
  221.         if(M4Vote > DeagleVote && M4Vote > ShotgunVote && M4Vote > Mp5Vote && M4Vote > SnipeVote )
  222.         {
  223.             ResetPlayerWeapons(playerid);
  224.             GivePlayerWeapon(playerid,31,99999);
  225.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Has Been Started With Gun M4");
  226.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Will Be End In 3 Min's");
  227.             TogglePlayerControllable(playerid,1);
  228.             PBGunID = 31;
  229.             SetTimer("PaintBallEnd",180000,false);
  230.         }
  231.         if(Mp5Vote > DeagleVote && Mp5Vote > ShotgunVote && Mp5Vote > M4Vote && Mp5Vote > SnipeVote )
  232.         {
  233.             ResetPlayerWeapons(playerid);
  234.             GivePlayerWeapon(playerid,29,99999);
  235.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Has Been Started With Gun Mp5");
  236.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Will Be End In 3 Min's");
  237.             TogglePlayerControllable(playerid,1);
  238.             PBGunID = 29;
  239.             SetTimer("PaintBallEnd",180000,false);
  240.         }
  241.         if(SnipeVote > DeagleVote && SnipeVote > ShotgunVote && SnipeVote > M4Vote && SnipeVote > M4Vote )
  242.         {
  243.             ResetPlayerWeapons(playerid);
  244.             GivePlayerWeapon(playerid,34,99999);
  245.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Has Been Started With Gun Sniper");
  246.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Match Will Be End In 3 Min's");
  247.             TogglePlayerControllable(playerid,1);
  248.             PBGunID = 34;
  249.             SetTimer("PaintBallEnd",180000,false);
  250.         }
  251.     }
  252.     return 1;
  253. }
  254. public PaintBallEnd(playerid)
  255. {
  256.     new string[128],string2[128],pName[MAX_PLAYER_NAME];
  257.    
  258.     GetPlayerName(PBLeaderid,pName,MAX_PLAYER_NAME);
  259.    
  260.     PBStarted = false;
  261.     DeagleVote = 0;
  262.     M4Vote = 0;
  263.     Mp5Vote = 0;
  264.     ShotgunVote = 0;
  265.     SnipeVote = 0;
  266.    
  267.     for(new i = 0;i < MAX_PLAYERS; i++)
  268.     {
  269.         if(PlayerPBing[i] == true)
  270.         {
  271.             SetPlayerPos(i,1310.1099,-1367.9067,13.5421);
  272.             ResetPlayerWeapons(i);
  273.             SetPlayerHealth(i,100.0);
  274.             SetPlayerArmour(i,0.0);
  275.             SendClientMessage(i,COLOR_YELLOW,"The Paintball Ended");
  276.             format(string,sizeof(string),""COL_WHITE"The Winner Of Paintball Is "COL_RED"%s(%d) "COL_WHITE"With Total of "COL_RED"%d "COL_WHITE"Kills",pName,PBLeaderid,PBLeaderKills);
  277.             format(string2,sizeof(string2),"Total Players Of This PaintBall Was %d",PBPlayers);
  278.             SendClientMessage(i,COLOR_WHITE,string);
  279.             SendClientMessage(i,COLOR_LIGHTBLUE,string2);
  280.             PlayerPBKills[i] = 0;
  281.             PlayerPBing[i] = false;
  282.             PBPlayers = 0;
  283.             PBLeaderid = 999;
  284.             PBLeaderKills = 0;
  285.             PBGunID = 0;
  286.         }
  287.     }
  288.     return 1;
  289. }
  290. CMD:enter(playerid, params[])
  291. {
  292.     if(IsPlayerInRangeOfPoint(playerid,3.0,1310.1099,-1367.9067,13.5421))
  293.     {
  294.         if(PBStarted == false)
  295.         {
  296.         new RandomSpawn = random(sizeof(PBSpawns));
  297.         new RandomSkin = random(sizeof(PBSkins));
  298.         SetPlayerSkin(playerid,PBSkins[RandomSkin]);
  299.         SetPlayerPos(playerid,PBSpawns[RandomSpawn][0],PBSpawns[RandomSpawn][1],PBSpawns[RandomSpawn][2]);
  300.         SetPlayerFacingAngle(playerid,PBSpawns[RandomSpawn][3]);
  301.         SetPlayerArmour(playerid,50.0);
  302.         SetPlayerHealth(playerid,100.0);
  303.         ShowPlayerDialog(playerid,Dialog_Paintball,2,"Vote For PaintBall Weapon :","Deagel\nShotgun\nM4\nMp5\nSniper","Vote","Quit");
  304.         TogglePlayerControllable(playerid,0);
  305.         PlayerPBing[playerid] = true;
  306.         PBPlayers++;
  307.         }
  308.         else
  309.         {
  310.             SendClientMessage(playerid,COLOR_LIGHTRED,"PaintBall Round Has Been Started You Need To Wait 3 Min's To Start New Round");
  311.         }
  312.     }
  313.     return 1;
  314. }
  315. CMD:gotosmall(playerid,params[])
  316. {
  317.     SetPlayerInterior(playerid,1);
  318.     SetPlayerPos(playerid,-1401.6968,107.1886,1032.2734);
  319.     return 1;
  320. }
  321. CMD:gotonormal(playerid,params[])
  322. {
  323.     SetPlayerInterior(playerid,14);
  324.     SetPlayerPos(playerid,-1486.5941,1567.7218,1052.5313);
  325.     return 1;
  326. }
  327. CMD:gotohuge(playerid,params[])
  328. {
  329.     SetPlayerInterior(playerid,15);
  330.     SetPlayerPos(playerid,-1365.6370,931.1339,1036.3071);
  331.     return 1;
  332. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement