Advertisement
Guest User

[Resurse SA:MP] Battle Arena

a guest
Dec 2nd, 2017
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. new IsInBA[MAX_PLAYERS];
  2. new Text:BATD[2];
  3. new BAPlayers;
  4.  
  5. // la OnPlayerDeath
  6. if(IsInBA[playerid] == 1)
  7. {
  8. BAPlayers -= 1;
  9. TextDrawHideForPlayer(playerid, BATD[0]);
  10. TextDrawHideForPlayer(playerid, BATD[1]);
  11. SetPlayerVirtualWorld(playerid, 0);
  12. SetPlayerHealthEx(playerid, 100);
  13. IsInBA[playerid] = 0;
  14. SCM(playerid, -1, "Because you died you have been respawned to your house.");
  15. }
  16. // La OnGameModeInit
  17. CreateObject(358, 1045.7656,1011.8483,11.0000, 0.00000, 0.00000, 0.00000);
  18. BAPlayers = 0;
  19.  
  20. BATD[0] = TextDrawCreate(126.000106, 322.906799, "PLAYERS");
  21. TextDrawLetterSize(BATD[0], 0.382400, 1.719467);
  22. TextDrawAlignment(BATD[0], 3);
  23. TextDrawColor(BATD[0], -1);
  24. TextDrawSetOutline(BATD[0], 1);
  25. TextDrawBackgroundColor(BATD[0], 255);
  26. TextDrawFont(BATD[0], 3);
  27. TextDrawSetProportional(BATD[0], 1);
  28.  
  29. BATD[1] = TextDrawCreate(69.999992, 320.666625, "10");
  30. TextDrawLetterSize(BATD[1], 0.367199, 2.130133);
  31. TextDrawAlignment(BATD[1], 3);
  32. TextDrawColor(BATD[1], -26113);
  33. TextDrawSetOutline(BATD[1], 1);
  34. TextDrawBackgroundColor(BATD[1], 255);
  35. TextDrawFont(BATD[1], 2);
  36. TextDrawSetProportional(BATD[1], 1);
  37.  
  38. Create3DTextLabel("{FFFF99}Battle Arena\n{FFFFFF}Type {FFFF99}[/enterba]{FFFFFF} to enter in arena.",0xFFFFFFFF,1045.7656,1011.8483,11.0000,5.0, 0, 1);
  39.  
  40. // La onPlayerConnect
  41. IsInBA[playerid] = 0;
  42. // Comenzile:
  43. CMD:enterba(playerid, params[])
  44. {
  45. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  46. if(IsPlayerInRangeOfPoint(playerid, 3.0, 1045.7656,1011.8483,11.0000))
  47. {
  48. SetPlayerVirtualWorld(playerid, 27127);
  49. IsInBA[playerid] = 1;
  50. BAPlayers += 1;
  51. TextDrawShowForPlayer(playerid, BATD[0]);
  52. TextDrawShowForPlayer(playerid, BATD[1]);
  53. GivePlayerWeaponEx(playerid, 24, 1000);
  54. GivePlayerWeaponEx(playerid, 31, 1000);
  55. SetPlayerHealthEx(playerid, 100);
  56. foreach(Player, i)
  57. {
  58. if(IsInBA[i] == 1) {
  59. new string[2];
  60. format(string, sizeof(string), "%d", BAPlayers);
  61. TextDrawSetString(BATD[1], string);
  62. TextDrawShowForPlayer(i, BATD[0]);
  63. TextDrawShowForPlayer(i, BATD[1]);
  64. }
  65. }
  66. SetPlayerPos(playerid, 2245.8538,1087.8802,469.6204);
  67. GivePlayerWeaponEx(playerid, 46, 1);
  68. SCM(playerid, -1, "You need to parachute in the castles to battle");
  69. }
  70. return 1;
  71. }
  72. CMD:exitba(playerid, params[])
  73. {
  74. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  75. if(IsInBA[playerid] == 1)
  76. {
  77. IsInBA[playerid] = 0;
  78. SCM(playerid, -1, "You have left Battle Arena");
  79. BAPlayers -= 1;
  80. SetPlayerVirtualWorld(playerid, 0);
  81. SetPlayerPos(playerid, 1045.7656,1011.8483,11.0000);
  82. TextDrawHideForPlayer(playerid, BATD[0]);
  83. TextDrawHideForPlayer(playerid, BATD[1]);
  84. foreach(Player, i)
  85. {
  86. if(IsInBA[i] == 1) {
  87. new string[2];
  88. format(string, sizeof(string), "%d", BAPlayers);
  89. TextDrawSetString(BATD[1], string);
  90. TextDrawShowForPlayer(i, BATD[0]);
  91. TextDrawShowForPlayer(i, BATD[1]);
  92. }
  93. }
  94. ResetPlayerWeaponsEx(playerid);
  95. SetPlayerHealthEx(playerid, 100);
  96. }
  97. return 1;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement