- --[[ ### Rocket-Hog Whores v1 ###]]--
- --[[ ### by H® Shaft ###]]--
- --[[ ### for Phasor v2 ###]]--
- -- spawns players in Rocket-hogs, (should not be used on indoor maps)
- -- should be used for large maps with outdoor player spawns
- -- player spawned vehicles respawn in 15 seconds after exit
- -- players can type 'hog', or 'HOG' to spawn a new vehicle
- -- optional: choose to have gametype spawned vehicles replaced by rocket-hogs, see below 'replace_vehicles'
- -- optional: choose to spawn players in vehicles (should be used only in large maps with outdoor player spawns)
- -- edit --
- replace_vehicles = true -- change to true if you want all gametype spawned vehicles replaced by rocket-hogs
- spawn_in_vehicle = true -- change to true if you want players to spawn in vehicles
- show_welcome_message = true -- joining players are welcomed if this is set to true
- -- don't edit --
- map_ids = {}
- game_started = false
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- if game == "PC" then
- map_name = readstring(0x698F21)
- else
- map_name = readstring(0x61D151)
- end
- LoadTags()
- GAME = game
- end
- function OnNewGame(map)
- if GAME == "PC" then
- map_name = readstring(0x698F21)
- else
- map_name = readstring(0x61D151)
- end
- LoadTags()
- game_started = true
- end
- function OnPlayerJoin(player)
- if getplayer(player) then
- if show_welcome_message then
- registertimer(5000, "timedwelcome", player)
- end
- end
- end
- function timedwelcome(id, count, player)
- if count == 1 then
- if getplayer(player) then
- privatesay(player, "Welcome to Rocket-hog Whores: to spawn a hog, type HOG")
- end
- end
- return false
- end
- function OnPlayerSpawnEnd(player, m_objectId)
- local m_player = getplayerobjectid(player)
- if m_player then
- if spawn_in_vehicle and game_started then
- putinvehicle = registertimer(300, "PutPlayerInVehicle", player)
- end
- end
- end
- function PutPlayerInVehicle(id, count, player)
- if count == 1 and game_started then
- local m_player = getplayerobjectid(player)
- local x,y,z = getobjectcoords(m_player)
- if map_ids[map_name] then
- if m_player then
- local m_vehicleId = createobject(map_ids[map_name], 0, 15, false, x,y,z+0.4)
- entervehicle(player, m_vehicleId, 0)
- end
- end
- end
- return false
- end
- function OnServerChat(player, type, message)
- local response = nil
- if player then
- if string.lower(message) == "hog" then
- local response = false
- local m_player = getplayerobjectid(player)
- if game_started then
- if m_player then
- if not isinvehicle(player) then
- local x,y,z = getobjectcoords(m_player)
- if map_ids[map_name] then
- local m_vehicleId = createobject(map_ids[map_name], 0, 15, false, x,y,z+0.4)
- entervehicle(player, m_vehicleId, 0)
- end
- else
- sendconsoletext(player, "**Derp** You already have a vehicle.")
- end
- else
- sendconsoletext(player, "**Derp** You cannot spawn a vehicle while dead.")
- end
- else
- sendconsoletext(player, "**Derp** You cannot spawn a hog after the game has ended.")
- end
- return response
- end
- end
- return response
- end
- function LoadTags()
- map_ids["beavercreek"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["bloodgulch"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["boardingaction"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["carousel"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["chillout"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["damnation"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["dangercanyon"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["deathisland"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["gephyrophobia"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["hangemhigh"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["icefields"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["infinity"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["longest"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["prisoner"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["putput"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["ratrace"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["sidewinder"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["timberland"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- map_ids["wizard"] = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- end
- function OnObjectCreationAttempt(mapId, parentId, player)
- if replace_vehicles then
- if mapId == gettagid("vehi", "vehicles\\warthog\\mp_warthog") then
- return gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- end
- if mapId == gettagid("vehi", "vehicles\\banshee\\banshee_mp") then
- return gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- end
- if mapId == gettagid("vehi", "vehicles\\ghost\\ghost_mp") then
- return gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- end
- if mapId == gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp") then
- return gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- end
- if mapId == gettagid("vehi", "vehicles\\scorpion\\scorpion_mp") then
- return gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
- end
- end
- end
- function OnGameEnd(stage)
- if stage == 1 then
- game_started = false
- if putinvehicle then
- putinvehicle = nil
- end
- end
- end
- -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
- -- Visit http://halorace.org/forum/index.php?topic=514.0 or
- -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Recent Pastes