Advertisement
fidle89

BluWar v0.8

Sep 8th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.58 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.  
  25. #pragma unused SetPlayerToTeamColor
  26.  
  27. new gTeam[MAX_PLAYERS];
  28.  
  29. main()
  30. {
  31.     print("\n------------------------");
  32.     print("Military Operations v0.04");
  33.     print("------------------------\n");
  34. }
  35.  
  36. public OnGameModeInit()
  37. {
  38.     SetGameModeText("CBCWAR v0.04");
  39.     ShowPlayerMarkers(0);
  40.     ShowNameTags(0);
  41.     AddPlayerClass(287,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // Revise Coords
  42.     AddPlayerClass(285,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // Revise Coords
  43.     return 1;
  44. }
  45.  
  46. public OnPlayerConnect(playerid)
  47. {
  48.     SendClientMessage(playerid,COLOR_GAME,"Welcome to Military Operations.");
  49.     SendClientMessage(playerid,COLOR_GAME,"Military Operations is a warzone roleplay server.");
  50.     SendClientMessage(playerid,COLOR_GAME,"Use {FF0000}/help {FFFFFF}and {FF0000}/commands {FFFFFF}for more help.");
  51.     return 1;
  52. }
  53.  
  54. public OnPlayerCommandText(playerid, cmdtext[])
  55. {
  56.     if(!strcmp(cmdtext, "/credits", true))
  57.     {
  58.         SendClientMessage(playerid,COLOR_GAME, "SERVER: Created by Chris Bluman with assistance from Brian Wright of The Asylum.");
  59.         return 1;
  60.     }
  61.     if(strcmp(cmdtext, "/enter", true) == 0)
  62.     {
  63.         if(IsPlayerInRangeOfPoint(playerid, 2,-179.8969,1087.9668,19.7422)) // Revise Coords
  64.         {
  65.             if(gTeam[playerid] == 1)
  66.             {
  67.                 SetPlayerInterior(playerid, 11);
  68.                 SetPlayerPos(playerid, 501.980987,-69.150199,988.757812); // Revise Coords
  69.                 SendClientMessage(playerid, COLOR_SANG, "Welcome to the Barracks");
  70.                 return 1;
  71.             }
  72.             else
  73.             {
  74.                 SendClientMessage(playerid, COLOR_BROWN, "This door is restricted to SANG.");
  75.                 return 1;
  76.             }
  77.         }
  78.     }
  79.     if(strcmp(cmdtext, "/exit", true) == 0)
  80.     {
  81.         if(IsPlayerInRangeOfPoint(playerid, 2,501.980987,-69.150199,988.757812)) // Revise Coords
  82.         {
  83.             SetPlayerInterior(playerid, 0);
  84.             SetPlayerPos(playerid, -179.8969,1087.9668,19.7422); // Revise Coords
  85.             return 1;
  86.         }
  87.     }
  88.     return 0;
  89. }
  90.  
  91. SetPlayerTeamFromClass(playerid, classid)
  92. {
  93.     if(classid == 0)
  94.     {
  95.         gTeam[playerid] = SANG;
  96.     }
  97.     if(classid == 1)
  98.     {
  99.         gTeam[playerid] = APLF;
  100.     }
  101. }
  102.  
  103. public OnPlayerRequestClass(playerid, classid)
  104. {
  105.     SetPlayerTeamFromClass(playerid, classid);
  106.     return 1;
  107. }
  108.  
  109. public OnPlayerSpawn(playerid)
  110. {
  111.     if(gTeam[playerid] == SANG)
  112.     {
  113.         SetPlayerInterior(playerid,0);
  114.         SetPlayerPos(playerid,2497.2693,-1676.9578,13.3398); // Revise Coords
  115.         return 1;
  116.     }
  117.     else if(gTeam[playerid] == APLF)
  118.     {
  119.         SetPlayerInterior(playerid,0);
  120.         SetPlayerPos(playerid,2497.2693,-1676.9578,13.3398); // Revise Coords
  121.         return 1;
  122.     }
  123.     return 1;
  124. }
  125.  
  126. SetPlayerToTeamColor(playerid)
  127. {
  128.     if(gTeam[playerid] == SANG)
  129.     {
  130.         SetPlayerColor(playerid,COLOR_SANG);
  131.     }
  132.     if(gTeam[playerid] == APLF)
  133.     {
  134.         SetPlayerColor(playerid,COLOR_APLF);
  135.     }
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement