Advertisement
Raminkh78

Gungame System v2.1

Sep 14th, 2015
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 24.33 KB | None | 0 0
  1. /*
  2.     †††††††††††††††† [GunGame System V 2.1] ††††††††††††††††
  3.     Good Luck With It !
  4.     ***********************************
  5.     ***    Created By [R]amin_       **
  6.     ***    khramin78@gmail.com       **
  7.     ***    Mobin.dfer@yahoo.com      **
  8.     ***********************************
  9.      I Hope This Gun Game FilterScript Will be usefull for you
  10.     †††††††††††††††† [GunGame System V 2.1] ††††††††††††††††
  11.     credits to :
  12.     [R]amin_
  13.     Zeex
  14.     Y_Less
  15. */
  16. /*
  17.  You Can Use These If You Want
  18. PlayerPlaySound(playerid,1068,0.0,0.0,0.0); duel start
  19. PlayerPlaySound(playerid,1069,0.0,0.0,0.0); duel stop
  20. PlayerPlaySound(playerid,1097,0.0,0.0,0.0); winner start
  21. PlayerPlaySound(playerid,1098,0.0,0.0,0.0); winner stop
  22. PlayerPlaySound(playerid,1083,0.0,0.0,0.0); Select Dialog
  23. */
  24.  
  25. #include <a_samp>
  26. #include <sscanf2>
  27. #include <Zcmd>
  28.  
  29. #define FILTERSCRIPT
  30.  
  31. #define COLOR_RED 0xAA3333AA
  32. #define COLOR_LIGHTRED 0xFF6347AA
  33. #define COLOR_LIGHTBLUE 0x33CCFFAA
  34. #define COLOR_YELLOW 0xFFFF00AA
  35. #define COLOR_WHITE 0xFFFFFFAA
  36.  
  37. #define COL_WHITE "{FFFFFF}"
  38. #define COL_RED "{F81414}"
  39. #define COL_YELLOW "{F3FF02}"
  40. #define COL_LRED "{FFA1A1}"
  41.  
  42. #define Dialog_GunGame 2001
  43. #define Dialog_GGBase 2002
  44. #define Dialog_GGArmor 2003
  45. #define Dialog_GGPrize 2004
  46. #define Dialog_GGPLimit 2005
  47.  
  48. forward GunGamePrepare();
  49. forward GunGameStart();
  50. forward GunGameEnd();
  51.  
  52. new PlayerGGKills[MAX_PLAYERS];
  53. new GGWinnerID = 999;
  54. new GGWinnerKills;
  55. new GGPlayers;
  56. new GGWinnerPrize;
  57. new bool:GGArmored;
  58. new bool:GGStarted;
  59. new bool:IsInGG[MAX_PLAYERS];
  60. new bool:IsGGHuge;
  61. new bool:IsAnyGG;
  62. new bool:IsGGNormal;
  63. new bool:IsGGSmall;
  64. new bool:IsSpecingGG[MAX_PLAYERS];
  65. new GGPlayerLimit;
  66. new PlayerGGWeapon[MAX_PLAYERS];
  67. new GGAdminid = 999;
  68. new GGPreTimer;
  69.  
  70. new GGSkins[] =
  71. {
  72.     137,
  73.     181,
  74.     212
  75. };
  76.  
  77. new Float:GGHugeSp[][] =
  78. {
  79.     {-1365.6370,931.1339,1036.3071,352.7964},
  80.     {-1311.4410,946.0482,1036.4771,32.5589},
  81.     {-1275.4701,995.0630,1037.2329,85.5754},
  82.     {-1303.2987,1040.6611,1038.0431,143.2554},
  83.     {-1303.2987,1040.6611,1038.0431,143.2554},
  84.     {-1279.7277,1007.9163,1037.4525,91.4661},
  85.     {-1347.5392,1056.2308,1038.3749,165.4683},
  86.     {-1406.7548,1059.8137,1038.5405,188.4176},
  87.     {-1406.7548,1059.8137,1038.5405,188.4176},
  88.     {-1363.5107,1059.4454,1038.4613,168.4137},
  89.     {-1443.3496,1057.9875,1038.5675,195.9038},
  90.     {-1482.1045,1047.2584,1038.4646,214.5578},
  91.     {-1515.5001,1009.6786,1037.8917,262.5427},
  92.     {-1511.8203,971.4282,1037.2567,297.6416},
  93.     {-1482.3848,948.8790,1036.7982,331.0224},
  94.     {-1462.9504,934.6046,1036.5898,342.3129},
  95.     {-1443.3665,933.4116,1036.4974,353.3582},
  96.     {-1424.1276,932.0661,1036.4058,357.4079},
  97.     {-1389.7131,935.9854,1036.4299,8.6986},
  98.     {-1440.0103,996.4330,1024.1982,87.2415},
  99.     {-1393.7437,997.6558,1024.1277,179.9061},
  100.     {-1346.6505,998.0483,1024.0538,269.9061}
  101. };
  102.  
  103. new Float:GGNormalSp[][] =
  104. {
  105.     {-1486.5941,1567.7218,1052.5313,319.5384},
  106.     {-1494.0847,1563.3784,1052.5313,358.0213},
  107.     {-1487.4187,1634.1917,1052.5313,273.0966},
  108.     {-1452.7310,1628.3412,1054.4141,273.1483},
  109.     {-1418.4728,1615.4061,1052.5313,279.7754},
  110.     {-1395.5817,1653.1403,1052.5313,184.5419},
  111.     {-1359.2196,1638.7040,1053.1034,258.4213},
  112.     {-1374.7731,1623.2323,1052.5313,93.0255},
  113.     {-1352.6407,1580.1671,1052.5313,168.5005},
  114.     {-1377.2875,1561.7327,1052.5313,2.3683},
  115.     {-1431.1586,1580.7185,1052.5313,243.6946},
  116.     {-1431.0129,1580.8337,1055.7191,357.0211}
  117. };
  118.  
  119. new Float:GGSmallSp[][] =
  120. {
  121.     {-1401.6968,107.1886,1032.2734,184.1404},
  122.     {-1384.2694,127.4698,1030.7107,134.1920},
  123.     {-1387.5258,84.2175,1031.0518,27.6681},
  124.     {-1425.6036,82.0811,1031.1155,301.2708},
  125.     {-1419.6563,127.9759,1030.7197,221.3775}
  126. };
  127.  
  128. #if defined FILTERSCRIPT
  129.  
  130. public OnFilterScriptInit()
  131. {
  132.     print("\n--------------------------------------");
  133.     print(" This FilterScript Has Been Made By [R]amin_");
  134.     print(" Conntect me on :");
  135.     print(" khramin78@gmail.com");
  136.     print(" mobin.dfer@yahoo.com");
  137.     print("--------------------------------------\n");
  138.    
  139.     GGStarted = false;
  140.     IsAnyGG = false;
  141.     GGArmored = false;
  142.     IsGGHuge = false;
  143.     IsGGSmall = false;
  144.     IsGGNormal = false;
  145.    
  146.     return 1;
  147. }
  148.  
  149. public OnFilterScriptExit()
  150. {
  151.     return 1;
  152. }
  153.  
  154. #endif
  155.  
  156. public OnPlayerConnect(playerid)
  157. {
  158.     IsInGG[playerid] = false;
  159.     PlayerGGKills[playerid] = 0;
  160.     PlayerGGWeapon[playerid] = 999;
  161.     IsSpecingGG[playerid] = false;
  162.    
  163.     return 1;
  164. }
  165.  
  166. public OnPlayerDisconnect(playerid, reason)
  167. {
  168.     if(IsInGG[playerid] == true)
  169.     {
  170.         GGPlayers--;
  171.     }
  172.     return 1;
  173. }
  174.  
  175. public OnPlayerSpawn(playerid)
  176. {
  177.     if(IsInGG[playerid] == true)
  178.     {
  179.         new RandomSkin = random(sizeof(GGSkins));
  180.         if(IsGGHuge == true)
  181.         {
  182.             new RandomSpawn = random(sizeof(GGHugeSp));
  183.             SetPlayerInterior(playerid,15);
  184.             SetPlayerSkin(playerid,GGSkins[RandomSkin]);
  185.             SetPlayerPos(playerid,GGHugeSp[RandomSpawn][0],GGHugeSp[RandomSpawn][1],GGHugeSp[RandomSpawn][2]);
  186.             SetPlayerFacingAngle(playerid,GGHugeSp[RandomSpawn][3]);
  187.             SetPlayerHealth(playerid,100.0);
  188.             ResetPlayerWeapons(playerid);
  189.             GivePlayerWeapon(playerid,PlayerGGWeapon[playerid],99999);
  190.             if(GGArmored == true)
  191.             {
  192.                 SetPlayerArmour(playerid,50.0);
  193.             }
  194.  
  195.         }
  196.         if(IsGGNormal == true)
  197.         {
  198.             new RandomSpawn = random(sizeof(GGNormalSp));
  199.             SetPlayerInterior(playerid,14);
  200.             SetPlayerSkin(playerid,GGSkins[RandomSkin]);
  201.             SetPlayerPos(playerid,GGNormalSp[RandomSpawn][0],GGNormalSp[RandomSpawn][1],GGNormalSp[RandomSpawn][2]);
  202.             SetPlayerFacingAngle(playerid,GGNormalSp[RandomSpawn][3]);
  203.             SetPlayerHealth(playerid,100.0);
  204.             ResetPlayerWeapons(playerid);
  205.             GivePlayerWeapon(playerid,PlayerGGWeapon[playerid],99999);
  206.             if(GGArmored == true)
  207.             {
  208.                 SetPlayerArmour(playerid,50.0);
  209.             }
  210.         }
  211.         if(IsGGSmall == true)
  212.         {
  213.             new RandomSpawn = random(sizeof(GGSmallSp));
  214.             SetPlayerInterior(playerid,1);
  215.             SetPlayerSkin(playerid,GGSkins[RandomSkin]);
  216.             SetPlayerPos(playerid,GGSmallSp[RandomSpawn][0],GGSmallSp[RandomSpawn][1],GGSmallSp[RandomSpawn][2]);
  217.             SetPlayerFacingAngle(playerid,GGSmallSp[RandomSpawn][3]);
  218.             SetPlayerHealth(playerid,100.0);
  219.             ResetPlayerWeapons(playerid);
  220.             GivePlayerWeapon(playerid,PlayerGGWeapon[playerid],99999);
  221.             if(GGArmored == true)
  222.             {
  223.                 SetPlayerArmour(playerid,50.0);
  224.             }
  225.         }
  226.     }
  227.     return 1;
  228. }
  229.  
  230. public OnPlayerDeath(playerid, killerid, reason)
  231. {
  232.     if(IsInGG[killerid] == true)
  233.     {
  234.         new string[128],pName[MAX_PLAYER_NAME];
  235.         GetPlayerName(killerid,pName,sizeof(pName));
  236.         PlayerGGKills[killerid]++;
  237.         if(PlayerGGKills[killerid] == 5)
  238.         {
  239.             ResetPlayerWeapons(killerid);
  240.             PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  241.             PlayerGGWeapon[killerid] = 25;
  242.             GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  243.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 2, Your Gun Is Shotgun Now");
  244.         }
  245.         if(PlayerGGKills[killerid] == 10)
  246.         {
  247.             ResetPlayerWeapons(killerid);
  248.             PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  249.             PlayerGGWeapon[killerid] = 28;
  250.             GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  251.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 3, Your Gun Is Uzi Now");
  252.         }
  253.         if(PlayerGGKills[killerid] == 15)
  254.         {
  255.             ResetPlayerWeapons(killerid);
  256.             PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  257.             PlayerGGWeapon[killerid] = 31;
  258.             GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  259.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 4, Your Gun Is M4 Now");
  260.         }
  261.         if(PlayerGGKills[killerid] == 20)
  262.         {
  263.             ResetPlayerWeapons(killerid);
  264.             PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  265.             PlayerGGWeapon[killerid] = 34;
  266.             GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  267.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 5, Your Gun Is Sniper Now");
  268.         }
  269.         if(PlayerGGKills[killerid] == 25)
  270.         {
  271.             ResetPlayerWeapons(killerid);
  272.             PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  273.             PlayerGGWeapon[killerid] = 16;
  274.             GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  275.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 6, Your Gun Is Grenade Now");
  276.         }
  277.         if(PlayerGGKills[killerid] == 26)
  278.         {
  279.             ResetPlayerWeapons(killerid);
  280.             PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  281.             PlayerGGWeapon[killerid] = 9;
  282.             GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  283.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 7, Your Gun Is ChainSaw Now");
  284.         }
  285.         if(PlayerGGKills[killerid] == 27)
  286.         {
  287.             for(new i=0;i<MAX_PLAYERS;i++)
  288.             {
  289.                 if(IsInGG[i] == true)
  290.                 {
  291.                     PlayerPlaySound(i,1097,0.0,0.0,0.0);
  292.                 }
  293.             }
  294.             ResetPlayerWeapons(killerid);
  295.             GGWinnerID = killerid;
  296.             SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 8, Your The Winner Of This GunGame");
  297.             SetTimer("GunGameEnd",200,false);
  298.         }
  299.         if(PlayerGGKills[killerid] > GGWinnerKills)
  300.         {
  301.             GGWinnerKills = PlayerGGKills[killerid];
  302.             GGWinnerID = killerid;
  303.             format(string,sizeof(string),"The Player "COL_RED"%s(%d) "COL_WHITE"Is In Lead With "COL_RED"%d "COL_WHITE" Kills",pName,killerid,PlayerGGKills[killerid]);
  304.             for(new i=0;i<MAX_PLAYERS;i++)
  305.             {
  306.                 if(IsInGG[i])
  307.                 {
  308.                     SendClientMessage(i,COLOR_WHITE,string);
  309.                 }
  310.             }
  311.         }
  312.     }
  313.     return 1;
  314. }
  315.  
  316. public OnPlayerCommandText(playerid, cmdtext[])
  317. {
  318.     return 1;
  319. }
  320.  
  321. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  322. {
  323.     return 1;
  324. }
  325.  
  326. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  327. {
  328.     if(dialogid == Dialog_GunGame)
  329.     {
  330.         if(response)
  331.         {
  332.             PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  333.             ShowPlayerDialog(playerid,Dialog_GGBase,2,"Select Gun Game Base:","Small Base\nNormal Base\nHuge Base","Select","Quit");
  334.         }
  335.     }
  336.     if(dialogid == Dialog_GGBase)
  337.     {
  338.         switch(listitem)
  339.         {
  340.             case 0:
  341.             {
  342.                 IsGGSmall = true;
  343.                 IsGGNormal = false;
  344.                 IsGGHuge = false;
  345.                 PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  346.                 ShowPlayerDialog(playerid,Dialog_GGArmor,2,"Choose A Setting of Armor","Gun Game With Armor\nGun Game Without Armor","Select","Back");
  347.             }
  348.             case 1:
  349.             {
  350.                 IsGGSmall = false;
  351.                 IsGGNormal = true;
  352.                 IsGGHuge = false;
  353.                 PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  354.                 ShowPlayerDialog(playerid,Dialog_GGArmor,2,"Choose A Setting of Armor","Gun Game With Armor\nGun Game Without Armor","Select","Back");
  355.             }
  356.             case 2:
  357.             {
  358.                 IsGGSmall = false;
  359.                 IsGGNormal = false;
  360.                 IsGGHuge = true;
  361.                 PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  362.                 ShowPlayerDialog(playerid,Dialog_GGArmor,2,"Choose A Setting of Armor","Gun Game With Armor\nGun Game Without Armor","Select","Back");
  363.             }
  364.         }
  365.     }
  366.     if(dialogid == Dialog_GGArmor)
  367.     {
  368.         switch(listitem)
  369.         {
  370.             case 0:
  371.             {
  372.                 GGArmored = true;
  373.                 PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  374.                 ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize ($1000.Min $15000.Max)::","Select","Back");
  375.                
  376.             }
  377.             case 1:
  378.             {
  379.                 GGArmored = false;
  380.                 PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  381.                 ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize ($1000.Min $15000.Max):","Select","Back");
  382.             }
  383.         }
  384.     }
  385.     if(dialogid == Dialog_GGPrize)
  386.     {
  387.         if(!strlen(inputtext)) return ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize ($1000.Min $15000.Max):","Select","Back");
  388.         if(strval(inputtext) > 15000 || strval(inputtext) < 1000) return ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize "COL_RED"($1000.Min $15000.Max):","Select","Back");
  389.         PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  390.         GGWinnerPrize = strval(inputtext);
  391.         ShowPlayerDialog(playerid,Dialog_GGPLimit,1,"Gun Game Player's:","Please Insert A Number For Player's Limit (5.Min 100.Max)::","Select","Quit");
  392.     }
  393.     if(dialogid == Dialog_GGPLimit)
  394.     {
  395.         if(!strlen(inputtext)) return ShowPlayerDialog(playerid,Dialog_GGPLimit,1,"Gun Game Player's:","Please Insert A Number For Player's Limit (5.Min 100.Max):","Select","Quit");
  396.         if(strval(inputtext) < 5 || strval(inputtext) > 100) return ShowPlayerDialog(playerid,Dialog_GGPLimit,1,"Gun Game Player's:","Please Insert A Number For Player's Limit "COL_RED"(5.Min 100.Max):","Select","Quit");
  397.         GGPlayerLimit = strval(inputtext);
  398.         SendClientMessage(playerid,COLOR_WHITE,"You Have Started A GunGame Match");
  399.         SendClientMessage(playerid,COLOR_WHITE,"You Have 5 Second's To Cancel This gungame "COL_RED"<< /cancelgungame >>");
  400.         GGPreTimer = SetTimer("GunGamePrepare",5000,false);
  401.     }
  402.     return 0;
  403. }
  404.  
  405. public GunGamePrepare()
  406. {
  407.     new string[255],pName[MAX_PLAYER_NAME];
  408.     GetPlayerName(GGAdminid,pName,sizeof(pName));
  409.     GGStarted = false;
  410.     IsAnyGG = true;
  411.     GGWinnerID = 999;
  412.     GGWinnerKills = 0;
  413.     format(string,sizeof(string),"A GunGame Match Has Been Started By Admin %s(%d) With Prize of : $%d And Limit of %d player's << /joingungame >>",pName,GGAdminid,GGWinnerPrize,GGPlayerLimit);
  414.     SendClientMessageToAll(COLOR_YELLOW,string);
  415.     SendClientMessageToAll(COLOR_YELLOW,"You Have 1 Minute's To join This Match! Be Hurry");
  416.     SetTimer("GunGameStart",60000,false);
  417.    
  418.     return 1;
  419. }
  420.  
  421. public GunGameStart()
  422. {
  423.     new RandomSkin = random(sizeof(GGSkins));
  424.     new string[128];
  425.     format(string,sizeof(string),"Gun Game Has Started With Prize Of "COL_YELLOW"$%d "COL_WHITE"& With "COL_YELLOW"%d/%d "COL_WHITE"Player's",GGWinnerPrize,GGPlayers,GGPlayerLimit);
  426.     SendClientMessageToAll(COLOR_WHITE,string);
  427.     SendClientMessageToAll(COLOR_YELLOW,"Now, You Can Watch this Match With /specgungame");
  428.     GGStarted = true;
  429.     for(new i=0;i<MAX_PLAYERS;i++)
  430.     {
  431.         if(IsInGG[i] == true)
  432.         {
  433.             if(IsGGSmall == true)
  434.             {
  435.                 new RandomSpawn = random(sizeof(GGSmallSp));
  436.                 if(GGArmored == true)
  437.                 {
  438.                     TogglePlayerControllable(i,1);
  439.                     SetPlayerInterior(i,1);
  440.                     SetPlayerSkin(i,GGSkins[RandomSkin]);
  441.                     SetPlayerPos(i,GGSmallSp[RandomSpawn][0],GGSmallSp[RandomSpawn][1],GGSmallSp[RandomSpawn][2]);
  442.                     SetPlayerFacingAngle(i,GGSmallSp[RandomSpawn][3]);
  443.                     SetPlayerHealth(i,100.0);
  444.                     SetPlayerArmour(i,50.0);
  445.                     SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  446.                     PlayerPlaySound(i,1069,0.0,0.0,0.0);
  447.                 }
  448.                 else
  449.                 {
  450.                     TogglePlayerControllable(i,1);
  451.                     SetPlayerInterior(i,1);
  452.                     SetPlayerSkin(i,GGSkins[RandomSkin]);
  453.                     SetPlayerPos(i,GGSmallSp[RandomSpawn][0],GGSmallSp[RandomSpawn][1],GGSmallSp[RandomSpawn][2]);
  454.                     SetPlayerFacingAngle(i,GGSmallSp[RandomSpawn][3]);
  455.                     SetPlayerHealth(i,100.0);
  456.                     SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  457.                     PlayerPlaySound(i,1069,0.0,0.0,0.0);
  458.                 }
  459.             }
  460.             if(IsGGNormal == true)
  461.             {
  462.                 new RandomSpawn = random(sizeof(GGNormalSp));
  463.                 if(GGArmored == true)
  464.                 {
  465.                     TogglePlayerControllable(i,1);
  466.                     SetPlayerInterior(i,14);
  467.                     SetPlayerSkin(i,GGSkins[RandomSkin]);
  468.                     SetPlayerPos(i,GGNormalSp[RandomSpawn][0],GGNormalSp[RandomSpawn][1],GGNormalSp[RandomSpawn][2]);
  469.                     SetPlayerFacingAngle(i,GGNormalSp[RandomSpawn][3]);
  470.                     SetPlayerHealth(i,100.0);
  471.                     SetPlayerArmour(i,50.0);
  472.                     SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  473.                     PlayerPlaySound(i,1069,0.0,0.0,0.0);
  474.                 }
  475.                 else
  476.                 {
  477.                     TogglePlayerControllable(i,1);
  478.                     SetPlayerInterior(i,14);
  479.                     SetPlayerSkin(i,GGSkins[RandomSkin]);
  480.                     SetPlayerPos(i,GGNormalSp[RandomSpawn][0],GGNormalSp[RandomSpawn][1],GGNormalSp[RandomSpawn][2]);
  481.                     SetPlayerFacingAngle(i,GGNormalSp[RandomSpawn][3]);
  482.                     SetPlayerHealth(i,100.0);
  483.                     SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  484.                     PlayerPlaySound(i,1069,0.0,0.0,0.0);
  485.                 }
  486.             }
  487.             if(IsGGHuge == true)
  488.             {
  489.                 new RandomSpawn = random(sizeof(GGHugeSp));
  490.                 if(GGArmored == true)
  491.                 {
  492.                     TogglePlayerControllable(i,1);
  493.                     SetPlayerInterior(i,15);
  494.                     SetPlayerSkin(i,GGSkins[RandomSkin]);
  495.                     SetPlayerPos(i,GGHugeSp[RandomSpawn][0],GGHugeSp[RandomSpawn][1],GGHugeSp[RandomSpawn][2]);
  496.                     SetPlayerFacingAngle(i,GGHugeSp[RandomSpawn][3]);
  497.                     SetPlayerHealth(i,100.0);
  498.                     SetPlayerArmour(i,50.0);
  499.                     SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  500.                     PlayerPlaySound(i,1069,0.0,0.0,0.0);
  501.                 }
  502.                 else
  503.                 {
  504.                     TogglePlayerControllable(i,1);
  505.                     SetPlayerInterior(i,15);
  506.                     SetPlayerSkin(i,GGSkins[RandomSkin]);
  507.                     SetPlayerPos(i,GGHugeSp[RandomSpawn][0],GGHugeSp[RandomSpawn][1],GGHugeSp[RandomSpawn][2]);
  508.                     SetPlayerFacingAngle(i,GGHugeSp[RandomSpawn][3]);
  509.                     SetPlayerHealth(i,100.0);
  510.                     SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  511.                     PlayerPlaySound(i,1069,0.0,0.0,0.0);
  512.                 }
  513.             }
  514.         }
  515.     }
  516.     return 1;
  517. }
  518.  
  519. public GunGameEnd()
  520. {
  521.     GGStarted = false;
  522.     IsAnyGG = false;
  523.     GGArmored = false;
  524.     IsGGHuge = false;
  525.     IsGGSmall = false;
  526.     IsGGNormal = false;
  527.     GGAdminid = 999;
  528.     for(new i=0;i<MAX_PLAYERS;i++)
  529.     {
  530.         if(IsInGG[i] == true)
  531.         {
  532.             PlayerPlaySound(i,1098,0.0,0.0,0.0);
  533.             new pName[MAX_PLAYER_NAME],string[128];
  534.             GetPlayerName(GGWinnerID,pName,sizeof(pName));
  535.             format(string,sizeof(string),"The Player "COL_RED"%s(%d) Won "COL_WHITE"The GunGame With Prize of : %d",pName,GGWinnerID,GGWinnerPrize);
  536.             SetPlayerInterior(i,0);
  537.             IsInGG[i] = false;
  538.             PlayerGGWeapon[i] = 0;
  539.             GivePlayerMoney(GGWinnerID,GGWinnerPrize);
  540.             SendClientMessageToAll(COLOR_WHITE,string);
  541.             GGPlayers = 0;
  542.             PlayerGGKills[i] = 0;
  543.             ResetPlayerWeapons(i);
  544.             SpawnPlayer(i);
  545.             SetPlayerPos(i,GetPVarFloat(i,"OldPosX"),GetPVarFloat(i,"OldPosY"),GetPVarFloat(i,"OldPosZ"));
  546.             DeletePVar(i,"OldPosX");
  547.             DeletePVar(i,"OldPosY");
  548.             DeletePVar(i,"OldPosZ");
  549.         }
  550.         if(IsSpecingGG[i] == true)
  551.         {
  552.             SetPlayerInterior(i,0);
  553.             SendClientMessage(i,COLOR_YELLOW,"GunGame Has Finished");
  554.             SpawnPlayer(i);
  555.             SetCameraBehindPlayer(i);
  556.             SetPlayerPos(i,GetPVarFloat(i,"oldPosX"),GetPVarFloat(i,"oldPosY"),GetPVarFloat(i,"oldPosZ"));
  557.             DeletePVar(i,"oldPosX");
  558.             DeletePVar(i,"oldPosY");
  559.             DeletePVar(i,"oldPosZ");
  560.             IsSpecingGG[i] = false;
  561.         }
  562.     }
  563.     return 1;
  564. }
  565.  
  566. CMD:gungame(playerid, params[])
  567. {
  568.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Are Not An Admin !");
  569.     if(GGStarted == true) return SendClientMessage(playerid,COLOR_LIGHTRED,"There Is A GunGame Started");
  570.     GGAdminid = playerid;
  571.     ShowPlayerDialog(playerid,Dialog_GunGame,0,""COL_WHITE"Gun Game Setting's",""COL_WHITE"This Is Perfect System To Make Gungame\nAre Your Sure You Want Make A Gun Game ?","Yes","No");
  572.     return 1;
  573. }
  574. CMD:joingungame(playerid, params[])
  575. {
  576.     if(GGStarted == true) return SendClientMessage(playerid,COLOR_YELLOW,"GunGame Has Been Started You Can Not Join !");
  577.     if(IsInGG[playerid] == true) return SendClientMessage(playerid,COLOR_YELLOW,"You Already Joined This Match");
  578.     if(IsAnyGG == false) return SendClientMessage(playerid,COLOR_YELLOW,"There Is No GunGame Started");
  579.     if(GGPlayers == GGPlayerLimit) return SendClientMessage(playerid,COLOR_YELLOW,"There is No Empty Room In GunGame");
  580.     new Float:OldX,Float:OldY,Float:OldZ;
  581.     GetPlayerPos(playerid,OldX,OldY,OldZ);
  582.     SetPVarFloat(playerid,"OldPosX",OldX);
  583.     SetPVarFloat(playerid,"OldPosY",OldY);
  584.     SetPVarFloat(playerid,"OldPosZ",OldZ);
  585.     SendClientMessage(playerid,COLOR_LIGHTBLUE,"You Have Joined This Gungame Match!!!");
  586.     SendClientMessage(playerid,COLOR_LIGHTBLUE,"Wait For 50 Second's To Let Other Player's Join");
  587.     ResetPlayerWeapons(playerid);
  588.     GivePlayerWeapon(playerid,24,9999);
  589.     TogglePlayerControllable(playerid,0);
  590.     GGPlayers++;
  591.     IsInGG[playerid] = true;
  592.     PlayerGGWeapon[playerid] = 24;
  593.     PlayerGGKills[playerid] = 0;
  594.     PlayerPlaySound(playerid,1068,0.0,0.0,0.0);
  595.     return 1;
  596. }
  597. CMD:specgungame(playerid,params[])
  598. {
  599.     if(IsAnyGG == false) return SendClientMessage(playerid,COLOR_RED,"There Is No Gun Game");
  600.     if(GGStarted == false) return SendClientMessage(playerid,COLOR_RED,"Gun Game Not Started Yet");
  601.     if(IsInGG[playerid] == true) return SendClientMessage(playerid,COLOR_RED,"You Can Not Spec While you Are In GunGame");
  602.     if(IsSpecingGG[playerid] == false)
  603.     {
  604.         new pName[MAX_PLAYER_NAME],string[128],Float:oldX,Float:oldY,Float:oldZ;
  605.         if(IsGGSmall == true)
  606.         {
  607.             SetPlayerInterior(playerid,1);
  608.             GetPlayerName(playerid,pName,sizeof(pName));
  609.             GetPlayerPos(playerid,oldX,oldY,oldZ);
  610.             SetPVarFloat(playerid,"oldPosX",oldX);
  611.             SetPVarFloat(playerid,"oldPosY",oldY);
  612.             SetPVarFloat(playerid,"oldPosZ",oldZ);
  613.             SetPlayerCameraPos(playerid,-1401.5728,107.2614,1090.8381);
  614.             SetPlayerCameraLookAt(playerid,-1401.6565,107.2420,1032.2734,CAMERA_CUT);
  615.             IsSpecingGG[playerid] = true;
  616.             SendClientMessage(playerid,COLOR_YELLOW,"You Are Now Watching GunGame use /specgungame Again To Stop Watching");
  617.             for(new i=0;i<MAX_PLAYERS;i++)
  618.             {
  619.                 if(IsInGG[i] == true)
  620.                 {
  621.                     format(string,sizeof(string),"Player "COL_RED"%s(%d) "COL_WHITE"Is Watching GunGame",pName,playerid);
  622.                     SendClientMessage(i,COLOR_WHITE,string);
  623.                 }
  624.             }
  625.         }
  626.  
  627.         if(IsGGNormal == true)
  628.         {
  629.             SetPlayerInterior(playerid,14);
  630.             GetPlayerName(playerid,pName,sizeof(pName));
  631.             GetPlayerPos(playerid,oldX,oldY,oldZ);
  632.             SetPVarFloat(playerid,"oldPosX",oldX);
  633.             SetPVarFloat(playerid,"oldPosY",oldY);
  634.             SetPVarFloat(playerid,"oldPosZ",oldZ);
  635.             SetPlayerCameraPos(playerid,-1349.1023,1555.9911,1082.7157);
  636.             SetPlayerCameraLookAt(playerid,-1446.3850,1620.6434,1054.4141,CAMERA_CUT);
  637.             IsSpecingGG[playerid] = true;
  638.             SendClientMessage(playerid,COLOR_YELLOW,"You Are Now Watching GunGame use /specgungame Again To Stop Watching");
  639.             for(new i=0;i<MAX_PLAYERS;i++)
  640.             {
  641.                 if(IsInGG[i] == true)
  642.                 {
  643.                     format(string,sizeof(string),"Player "COL_RED"%s(%d) "COL_WHITE"Is Watching GunGame",pName,playerid);
  644.                     SendClientMessage(i,COLOR_WHITE,string);
  645.                 }
  646.             }
  647.         }
  648.         if(IsGGHuge == true)
  649.         {
  650.             SetPlayerInterior(playerid,15);
  651.             GetPlayerName(playerid,pName,sizeof(pName));
  652.             GetPlayerPos(playerid,oldX,oldY,oldZ);
  653.             SetPVarFloat(playerid,"oldPosX",oldX);
  654.             SetPVarFloat(playerid,"oldPosY",oldY);
  655.             SetPVarFloat(playerid,"oldPosZ",oldZ);
  656.             SetPlayerCameraPos(playerid,-1345.1965,927.7277,1059.6145);
  657.             SetPlayerCameraLookAt(playerid,-1387.4464,994.6185,1024.0735,CAMERA_CUT);
  658.             IsSpecingGG[playerid] = true;
  659.             SendClientMessage(playerid,COLOR_YELLOW,"You Are Now Watching GunGame use /specgungame Again To Stop Watching");
  660.             for(new i=0;i<MAX_PLAYERS;i++)
  661.             {
  662.                 if(IsInGG[i] == true)
  663.                 {
  664.                     format(string,sizeof(string),"Player "COL_RED"%s(%d) "COL_WHITE"Is Watching GunGame",pName,playerid);
  665.                     SendClientMessage(i,COLOR_WHITE,string);
  666.                 }
  667.             }
  668.         }
  669.     }
  670.     else
  671.     {
  672.         SendClientMessage(playerid,COLOR_YELLOW,"You Have Stopped Specing GunGame");
  673.         SetPlayerInterior(playerid,0);
  674.         SpawnPlayer(playerid);
  675.         SetCameraBehindPlayer(playerid);
  676.         SetPlayerPos(playerid,GetPVarFloat(playerid,"oldPosX"),GetPVarFloat(playerid,"oldPosY"),GetPVarFloat(playerid,"oldPosZ"));
  677.         DeletePVar(playerid,"oldPosX");
  678.         DeletePVar(playerid,"oldPosY");
  679.         DeletePVar(playerid,"oldPosZ");
  680.         IsSpecingGG[playerid] = false;
  681.  
  682.     }
  683.     return 1;
  684. }
  685. CMD:stopgungame(playerid,params[])
  686. {
  687.     if(IsAnyGG == false) return SendClientMessage(playerid,COLOR_RED,"There Is No Gun Game");
  688.     if(GGStarted == false) return SendClientMessage(playerid,COLOR_RED,"GunGame Is Not Started Yet");
  689.     if(GGAdminid != playerid) return SendClientMessage(playerid,COLOR_RED,"You Are Not Admin of This Gungame !");
  690.     SendClientMessageToAll(COLOR_YELLOW,"Gun Game Has Been Stopped By An Admin!");
  691.     SetTimer("GunGameEnd",900,false);
  692.     return 1;
  693. }
  694. CMD:cancelgungame(playerid,params[])
  695. {
  696.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Are Not Admin");
  697.     if(GGStarted == true) return SendClientMessage(playerid,COLOR_RED,"This Gun Game Has Been Started");
  698.     if(GGAdminid != playerid) return SendClientMessage(playerid,COLOR_RED,"You Are Not Admin Of This GunGame");
  699.     SendClientMessage(playerid,COLOR_YELLOW,"You Have Canceled GunGame");
  700.     KillTimer(GGPreTimer);
  701.     return 1;
  702. }
  703. CMD:gungamers(playerid,params[])
  704. {
  705.     new pName[MAX_PLAYER_NAME],string[128];
  706.     for(new i=0;i<MAX_PLAYERS;i++)
  707.     {
  708.         if(IsInGG[i] == true)
  709.         {
  710.             GetPlayerName(i,pName,sizeof(pName));
  711.             format(string,sizeof(string),""COL_YELLOW"- "COL_WHITE"%s(%d) With %d Kill's",pName,i,PlayerGGKills[i]);
  712.             SendClientMessage(playerid,COLOR_WHITE,string);
  713.         }
  714.     }
  715.     return 1;
  716. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement