Advertisement
fidle89

BluWar v0.9

Sep 9th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.86 KB | None | 0 0
  1. //      |------------------------------------|
  2. //              |                                |
  3. //              |         Military Operations        |
  4. //              |        A Warzone RP Script         |
  5. //              |          By Chris Bluman           |
  6. //              |     http://theasylumhangout.com    |
  7. //              |                                    |
  8. //              |------------------------------------|
  9.  
  10.  
  11. #include <a_samp>
  12. #include <core>
  13. #include <float>
  14.  
  15. #define SANG 0          // San Andreas National Guard
  16. #define APLF 1          // Andrean Public Liberation Front
  17. #define COLOR_GAME      0xFFFFFFFF
  18. #define COLOR_CHAT      0xCCFFCCAA
  19. #define COLOR_ADMIN     0x0000FFAA
  20. #define COLOR_COMMAND   0x800000AA
  21. #define COLOR_SANG      0x4CBB17AA
  22. #define COLOR_APLF      0x008080AA
  23. #define COLOR_BROWN     0x964B00AA
  24. #define DIALOG_LOCKER   1
  25.  
  26. new gTeam[MAX_PLAYERS];
  27.  
  28. main()
  29. {
  30.     print("\n------------------------");
  31.     print("Military Operations v0.09");
  32.     print("------------------------\n");
  33. }
  34.  
  35. public OnGameModeInit()
  36. {
  37.     SetGameModeText("CBCWAR v0.09");
  38.     ShowPlayerMarkers(0);
  39.     ShowNameTags(1);
  40.     AddPlayerClass(287,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // Revise Coords
  41.     AddPlayerClass(285,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // Revise Coords
  42.     return 1;
  43. }
  44.  
  45. public OnPlayerConnect(playerid)
  46. {
  47.     SendClientMessage(playerid,COLOR_GAME,"Welcome to Military Operations.");
  48.     SendClientMessage(playerid,COLOR_GAME,"Military Operations is a warzone roleplay server.");
  49.     SendClientMessage(playerid,COLOR_GAME,"Use {FF0000}/help {FFFFFF}and {FF0000}/commands {FFFFFF}for more help.");
  50.     return 1;
  51. }
  52.  
  53. public OnPlayerCommandText(playerid, cmdtext[])
  54. {
  55.     if(!strcmp(cmdtext, "/credits", true))
  56.     {
  57.         SendClientMessage(playerid,COLOR_GAME, "SERVER: Created by Chris Bluman with assistance from Brian Wright of The Asylum.");
  58.         return 1;
  59.     }
  60.     if(strcmp(cmdtext, "/locker", true))
  61.     {
  62.         if(IsPlayerInRangeOfPoint(playerid, 5,2497.2693,-1676.9578,13.3398)) // Revise Coords
  63.         {
  64.             ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Armory Locker", "First Aid Kit\nKevlar Armour\nSilenced Pistol\nDesert Eagle\nPump Shotgun\nSpas 12\nMP5\nAK47\nM4A1\nSniper Rifle\nRPG\nHS-RPG\nGrenade\nC4\nBinoculars\nParachute", "Add to Gear", "Close Locker");
  65.             return 1;
  66.         }
  67.     }
  68.     if(strcmp(cmdtext, "/enter", true) == 0)
  69.     {
  70.         if(IsPlayerInRangeOfPoint(playerid, 2,-179.8969,1087.9668,19.7422)) // Revise Coords
  71.         {
  72.             if(gTeam[playerid] == 1)
  73.             {
  74.                 SetPlayerInterior(playerid, 11);
  75.                 SetPlayerPos(playerid, 501.980987,-69.150199,988.757812); // Revise Coords
  76.                 SendClientMessage(playerid, COLOR_SANG, "Welcome to the Barracks");
  77.                 return 1;
  78.             }
  79.             else
  80.             {
  81.                 SendClientMessage(playerid, COLOR_BROWN, "This door is restricted to SANG.");
  82.                 return 1;
  83.             }
  84.         }
  85.     }
  86.     if(strcmp(cmdtext, "/exit", true) == 0)
  87.     {
  88.         if(IsPlayerInRangeOfPoint(playerid, 2,501.980987,-69.150199,988.757812)) // Revise Coords
  89.         {
  90.             SetPlayerInterior(playerid, 0);
  91.             SetPlayerPos(playerid, -179.8969,1087.9668,19.7422); // Revise Coords
  92.             return 1;
  93.         }
  94.     }
  95.     return 0;
  96. }
  97.  
  98. SetupPlayerForClassSelection(playerid)
  99. {
  100.     SetPlayerInterior(playerid,14);
  101.     SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  102.     SetPlayerFacingAngle(playerid,360.0);
  103.     SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  104.     SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); // Revise Coords
  105. }
  106.  
  107. SetPlayerTeamFromClass(playerid, classid)
  108. {
  109.     if(classid == 0)
  110.     {
  111.         gTeam[playerid] = SANG;
  112.     }
  113.     if(classid == 1)
  114.     {
  115.         gTeam[playerid] = APLF;
  116.     }
  117. }
  118.  
  119. public OnPlayerRequestClass(playerid, classid)
  120. {
  121.     SetupPlayerForClassSelection(playerid);
  122.     SetPlayerTeamFromClass(playerid, classid);
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerSpawn(playerid)
  127. {
  128.     if(gTeam[playerid] == SANG)
  129.     {
  130.         SetPlayerInterior(playerid,0);
  131.         TogglePlayerClock(playerid,0);
  132.         SetPlayerPos(playerid,2497.2693,-1676.9578,13.3398); // Revise Coords
  133.         SetPlayerColor(playerid, COLOR_SANG);
  134.         return 1;
  135.     }
  136.     else if(gTeam[playerid] == APLF)
  137.     {
  138.         SetPlayerInterior(playerid,0);
  139.         TogglePlayerClock(playerid,0);
  140.         SetPlayerPos(playerid,2497.2693,-1676.9578,13.3398); // Revise Coords
  141.         SetPlayerColor(playerid, COLOR_APLF);
  142.         return 1;
  143.     }
  144.     return 1;
  145. }
  146.  
  147. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  148. {
  149.     if(dialogid == DIALOG_LOCKER)
  150.     {
  151.         if(response) // Selected an object
  152.         {
  153.             if(listitem == 0) // First Aid Kit
  154.             {
  155.                 SetPlayerHealth(playerid, 100.0);
  156.                 return 1;
  157.             }
  158.             if(listitem == 1) // Kevlar Armour
  159.             {
  160.                 SetPlayerArmour(playerid, 100.0);
  161.                 return 1;
  162.             }
  163.             if(listitem == 2) // Silenced Pistol
  164.             {
  165.                 GivePlayerWeapon(playerid, 23, 50);
  166.             }
  167.             if(listitem == 3) // Desert eagle
  168.             {
  169.                 GivePlayerWeapon(playerid, 24, 50);
  170.             }
  171.             if(listitem == 4) // Pump Shotgun
  172.             {
  173.                 GivePlayerWeapon(playerid, 25, 50);
  174.             }
  175.             if(listitem == 5) // Spas-12
  176.             {
  177.                 GivePlayerWeapon(playerid, 27, 57);
  178.             }
  179.             if(listitem == 6) // MP5
  180.             {
  181.                 GivePlayerWeapon(playerid, 29, 200);
  182.             }
  183.             if(listitem == 7) // AK47
  184.             {
  185.                 GivePlayerWeapon(playerid, 30, 200);
  186.             }
  187.             if(listitem == 8) // M4A1
  188.             {
  189.                 GivePlayerWeapon(playerid, 31, 200);
  190.             }
  191.             if(listitem == 9) // Sniper Rifle
  192.             {
  193.                 GivePlayerWeapon(playerid, 34, 75);
  194.             }
  195.             if(listitem == 10) // RPG
  196.             {
  197.                 GivePlayerWeapon(playerid, 35, 5);
  198.             }
  199.             if(listitem == 11) // HS-RPG
  200.             {
  201.                 GivePlayerWeapon(playerid, 36, 5);
  202.             }
  203.             if(listitem == 12) // C4
  204.             {
  205.                 GivePlayerWeapon(playerid, 39, 5);
  206.             }
  207.             if(listitem == 13) // Binoculars
  208.             {
  209.                 GivePlayerWeapon(playerid, 43, 1);
  210.             }
  211.             if(listitem == 14) // Parachute
  212.             {
  213.                 GivePlayerWeapon(playerid, 46, 1);
  214.             }
  215.         }
  216.         return 1;
  217.     }
  218.     return 0;
  219. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement