Guest User

Untitled

a guest
Mar 4th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. #include <a_samp>
  2. #include <foreach>
  3. main()
  4. {
  5. print("sSumo by spedico");
  6. }
  7.  
  8. new IsInRing[MAX_PLAYERS];
  9. new Float:Ring1Spawns[][4] =
  10. {
  11. // X, Y, Z, Floating angle
  12. {1497.3978,-1081.6727,181.5744,268.1943},
  13. {1540.6831,-1084.3839,181.5744,92.3531},
  14. {1506.7559,-1060.8977,181.5744,181.7378},
  15. {1497.3978,-1081.6727,181.5744,268.1943}
  16. };
  17.  
  18. enum Rings
  19. {
  20. Ring1
  21. }
  22.  
  23.  
  24.  
  25. public OnGameModeInit()
  26. {
  27. SetGameModeText("NOPE.");
  28. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); // Default spawn
  29. SetTimer("SumoCheck", 5000, true);
  30. return 1;
  31. }
  32.  
  33. public OnGameModeExit()
  34. {
  35. return 1;
  36. }
  37.  
  38. public OnPlayerDeath(playerid, killerid, reason)
  39. {
  40. IsInRing[playerid] = 0;
  41. DestroyVehicle(GetPlayerVehicleID(playerid));
  42. }
  43.  
  44. public OnPlayerRequestClass(playerid, classid)
  45. {
  46. SpawnPlayer(playerid);
  47. return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52. IsInRing[playerid] = 0;
  53. return 1;
  54. }
  55.  
  56. public OnPlayerDisconnect(playerid, reason)
  57. {
  58. IsInRing[playerid] = 0;
  59. return 1;
  60. }
  61.  
  62. public OnPlayerSpawn(playerid)
  63. {
  64. new rand = random(sizeof(Ring1Spawns));
  65. SetPlayerPos(playerid, Ring1Spawns[rand][0], Ring1Spawns[rand][1], Ring1Spawns[rand][2]);
  66. SetTimer("GetReady", 1000, false);
  67. return 1;
  68. }
  69.  
  70. public OnPlayerExitVehicle(playerid, vehicleid)
  71. {
  72. IsInRing[playerid] = 0;
  73. new name[MAX_PLAYER_NAME], string[64];
  74. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  75. format(string, sizeof(string), "%s died/left vehicle.", name);
  76. DestroyVehicle(vehicleid);
  77. SendClientMessageToAll(-1, string);
  78. Kill(playerid);
  79. return 1;
  80. }
  81.  
  82. forward GetReady(playerid);
  83. public GetReady(playerid)
  84. {
  85. new Float:X, Float:Y, Float:Z;
  86. GetPlayerPos(playerid, X, Y, Z);
  87. new veh = CreateVehicle(444, X, Y, Z, 1, 0, 0, 60);
  88. PutPlayerInVehicle(playerid, veh, 0);
  89. IsInRing[playerid] = 1;
  90. }
  91.  
  92. forward Kill(playerid);
  93. public Kill(playerid)
  94. {
  95. SetPlayerHealth(playerid, 0);
  96. }
  97.  
  98. forward SumoCheck();
  99. public SumoCheck()
  100. {
  101. foreach(Player, i)
  102. {
  103. print("SumoCheck ran successfully.");
  104. new Float:X, Float:Y, Float:Z;
  105. GetPlayerPos(i, X, Y, Z);
  106. if(Z < 175 && IsInRing[i] == 1)
  107. {
  108. IsInRing[i] = 0;
  109. SendClientMessage(i, -1, "You fell.");
  110. new Name[MAX_PLAYER_NAME], string[64];
  111. GetPlayerName(i, Name, MAX_PLAYER_NAME);
  112. format(string, sizeof(string), "%s fell.", Name);
  113. SendClientMessageToAll(-1, string);
  114. DestroyVehicle(GetPlayerVehicleID(i));
  115. Kill(i);
  116. }
  117. }
  118. }
Advertisement
Add Comment
Please, Sign In to add comment