- --[[ ### Tank Whores ###]]--
- --[[ ### by H® Shaft ###]]--
- --[[ ### for Phasor v2 ###]]--
- -- spawns players in tanks, (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 'tank' to spawn a new tank
- -- optional: choose to have gametype spawned vehicles replaced by tanks, 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 tanks
- spawn_in_vehicle = false -- change to true if you want players to spawn in vehicles
- -- don't edit --
- map_ids = {}
- 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()
- end
- function OnPlayerSpawnEnd(player, m_objectId)
- local m_player = getplayerobjectid(player)
- if m_player then
- if spawn_in_vehicle then
- putinvehicle = registertimer(300, "PutPlayerInVehicle", player)
- end
- end
- end
- function PutPlayerInVehicle(id, count, player)
- if count == 1 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 true
- end
- function OnGameEnd(stage)
- if stage == 1 then
- if putinvehicle then
- removetimer(putinvehicle)
- putinvehicle = nil
- end
- end
- end
- function OnServerChat(player, type, message)
- local response = nil
- if player then
- if string.lower(message) == "tank" then
- local response = false
- local m_player = getplayer(player)
- if m_player then
- if not isinvehicle(player) then
- local m_player = getplayerobjectid(player)
- if m_player then x,y,z = getobjectcoords(m_player) end
- if map_ids[map_name] then
- local m_vehicleId = createobject(map_ids[map_name], 0, 15, false, x,y,z+1)
- entervehicle(player, m_vehicleId, 0)
- end
- else
- sendconsoletext(player, "**Derp** You already have a vehicle.")
- end
- end
- return response
- end
- end
- return response
- end
- function OnPlayerJoin(player)
- registertimer(5000, "timedwelcome", player)
- end
- function timedwelcome(id, count, player)
- if count == 1 then
- if getplayer(player) then
- privatesay(player, "Welcome to Tank Whores: to spawn a tank, type TANK")
- end
- end
- return true
- end
- function LoadTags()
- map_ids["beavercreek"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["bloodgulch"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["boardingaction"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["carousel"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["chillout"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["damnation"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["dangercanyon"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["deathisland"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["gephyrophobia"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["hangemhigh"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["icefields"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["infinity"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["longest"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["prisoner"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["putput"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["ratrace"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["sidewinder"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["timberland"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- map_ids["wizard"] = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- end
- function OnObjectCreationAttempt(mapId, parentId, player)
- if replace_vehicles then
- if mapId == gettagid("vehi", "vehicles\\rwarthog\\rwarthog") then
- return gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- end
- if mapId == gettagid("vehi", "vehicles\\warthog\\mp_warthog") then
- return gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- end
- if mapId == gettagid("vehi", "vehicles\\banshee\\banshee_mp") then
- return gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- end
- if mapId == gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp") then
- return gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- end
- if mapId == gettagid("vehi", "vehicles\\ghost\\ghost_mp") then
- return gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
- 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