Guest User

Untitled

a guest
Mar 4th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 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. return 1;
  43. }
  44.  
  45. public OnPlayerRequestClass(playerid, classid)
  46. {
  47. SpawnPlayer(playerid);
  48. return 1;
  49. }
  50.  
  51. public OnPlayerConnect(playerid)
  52. {
  53. IsInRing[playerid] = 0;
  54. return 1;
  55. }
  56.  
  57. public OnPlayerDisconnect(playerid, reason)
  58. {
  59. IsInRing[playerid] = 0;
  60. return 1;
  61. }
  62.  
  63. public OnPlayerSpawn(playerid)
  64. {
  65. new rand = random(sizeof(Ring1Spawns));
  66. SetPlayerPos(playerid, Ring1Spawns[rand][0], Ring1Spawns[rand][1], Ring1Spawns[rand][2]);
  67. SetTimerEx("GetReady", 1000, false, "d", playerid);
  68. return 1;
  69. }
  70.  
  71. public OnPlayerExitVehicle(playerid, vehicleid)
  72. {
  73. IsInRing[playerid] = 0;
  74. new name[MAX_PLAYER_NAME], string[64];
  75. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  76. format(string, sizeof(string), "%s died/left vehicle.", name);
  77. DestroyVehicle(vehicleid);
  78. SendClientMessageToAll(-1, string);
  79. Kill(playerid);
  80. return 1;
  81. }
  82.  
  83. forward GetReady(playerid);
  84. public GetReady(playerid)
  85. {
  86. new Float:X, Float:Y, Float:Z;
  87. GetPlayerPos(playerid, X, Y, Z);
  88. new veh = CreateVehicle(444, X, Y, Z, 1, 0, 0, 60);
  89. PutPlayerInVehicle(playerid, veh, 0);
  90. IsInRing[playerid] = 1;
  91. return 1;
  92. }
  93.  
  94. forward Kill(playerid);
  95. public Kill(playerid)
  96. {
  97. SetPlayerHealth(playerid, 0);
  98. return 1;
  99. }
  100.  
  101. forward SumoCheck();
  102. public SumoCheck()
  103. {
  104. for(new i=0; i<MAX_PLAYERS; i++)
  105. {
  106. print("SumoCheck ran successfully.");
  107. if(!IsPlayerConnected(i)) continue;
  108. new Float:X, Float:Y, Float:Z;
  109. GetPlayerPos(i, X, Y, Z);
  110. if(Z < 175 && IsInRing[i] == 1)
  111. {
  112. IsInRing[i] = 0;
  113. SendClientMessage(i, -1, "You fell.");
  114. new Name[MAX_PLAYER_NAME], string[64];
  115. GetPlayerName(i, Name, MAX_PLAYER_NAME);
  116. format(string, sizeof(string), "%s fell.", Name);
  117. SendClientMessageToAll(-1, string);
  118. DestroyVehicle(GetPlayerVehicleID(i));
  119. Kill(i);
  120. }
  121. }
  122. return 1;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment