Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <foreach>
- main()
- {
- print("sSumo by spedico");
- }
- new IsInRing[MAX_PLAYERS];
- new Float:Ring1Spawns[][4] =
- {
- // X, Y, Z, Floating angle
- {1497.3978,-1081.6727,181.5744,268.1943},
- {1540.6831,-1084.3839,181.5744,92.3531},
- {1506.7559,-1060.8977,181.5744,181.7378},
- {1497.3978,-1081.6727,181.5744,268.1943}
- };
- enum Rings
- {
- Ring1
- }
- public OnGameModeInit()
- {
- SetGameModeText("NOPE.");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); // Default spawn
- SetTimer("SumoCheck", 5000, true);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- IsInRing[playerid] = 0;
- DestroyVehicle(GetPlayerVehicleID(playerid));
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SpawnPlayer(playerid);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- IsInRing[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- IsInRing[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new rand = random(sizeof(Ring1Spawns));
- SetPlayerPos(playerid, Ring1Spawns[rand][0], Ring1Spawns[rand][1], Ring1Spawns[rand][2]);
- SetTimerEx("GetReady", 1000, false, "d", playerid);
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- IsInRing[playerid] = 0;
- new name[MAX_PLAYER_NAME], string[64];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- format(string, sizeof(string), "%s died/left vehicle.", name);
- DestroyVehicle(vehicleid);
- SendClientMessageToAll(-1, string);
- Kill(playerid);
- return 1;
- }
- forward GetReady(playerid);
- public GetReady(playerid)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- new veh = CreateVehicle(444, X, Y, Z, 1, 0, 0, 60);
- PutPlayerInVehicle(playerid, veh, 0);
- IsInRing[playerid] = 1;
- return 1;
- }
- forward Kill(playerid);
- public Kill(playerid)
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- forward SumoCheck();
- public SumoCheck()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- print("SumoCheck ran successfully.");
- if(!IsPlayerConnected(i)) continue;
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(i, X, Y, Z);
- if(Z < 175 && IsInRing[i] == 1)
- {
- IsInRing[i] = 0;
- SendClientMessage(i, -1, "You fell.");
- new Name[MAX_PLAYER_NAME], string[64];
- GetPlayerName(i, Name, MAX_PLAYER_NAME);
- format(string, sizeof(string), "%s fell.", Name);
- SendClientMessageToAll(-1, string);
- DestroyVehicle(GetPlayerVehicleID(i));
- Kill(i);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment