Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local marineModelName = "models/marine/male/male.model"
- local marineSpecialModelName = "models/marine/male/male_special.model"
- local skulkModelName = "models/alien/skulk/skulk.model"
- local fadeModelName = "models/alien/fade/fade.model"
- local lerkModelName = "models/alien/lerk/lerk.model"
- local gorgeModelName = "models/alien/gorge/gorge.model"
- local eggModelname = "models/alien/egg/egg.model"
- local readyRoomPlayerClassName = "ReadyRoomPlayer"
- local marineClassName = "Marine"
- local skulkClassName = "Skulk"
- local fadeClassName = "Fade"
- local lerkClassName = "Lerk"
- local gorgeClassName = "Gorge"
- local eggClassName = "Embryo"
- function PlayerHasMarineModel(playerEntity)
- if playerEntity:isa(marineClassName) then
- return true
- //i think this is faster then going straight to the GetModelName() string compare.
- elseif playerEntity:isa(readyRoomPlayerClassName) then
- local modelName = playerEntity:GetModelName()
- return modelName == marineModelName or modelName == marineSpecialModelName
- end
- return false
- end
- function PlayerHasSkulkModel(playerEntity)
- if playerEntity:isa(skulkClassName) then
- return true
- elseif playerEntity:isa(readyRoomPlayerClassName) then
- return playerEntity:GetModelName() == skulkModelName
- end
- return false
- end
- function PlayerHasLerkModel(playerEntity)
- if playerEntity:isa(lerkClassName) then
- return true
- elseif playerEntity:isa(readyRoomPlayerClassName) then
- return playerEntity:GetModelName() == lerkModelName
- end
- return false
- end
- function PlayerHasFadeModel(playerEntity)
- if playerEntity:isa(fadeClassName) then
- return true
- elseif playerEntity:isa(readyRoomPlayerClassName) then
- return playerEntity:GetModelName() == fadeModelName
- end
- return false
- end
- function PlayerHasGorgeModel(playerEntity)
- if playerEntity:isa(gorgeClassName) then
- return true
- elseif playerEntity:isa(readyRoomPlayerClassName) then
- return playerEntity:GetModelName() == gorgeModelName
- end
- return false
- end
- function PlayerHasEggModel(playerEntity)
- if playerEntity:isa(eggClassName) then
- return true
- elseif playerEntity:isa(readyRoomPlayerClassName) then
- return playerEntity:GetModelName() == eggModelName
- end
- return false
- end
- //this (incomplete at the moment) function is specific to my application of figuring out where to put the name and icon for a player, but how it works could be useful for someone.
- function GetPlayerNameAndImageAttachmentPoints(playerEntity)
- //I'm gonna upload a more optimized version of all this code as soon as i can.
- //For now note that calling playerEntity:GetAttachPointOrigin("JetPack") is unnecessary because attachPointCoords.origin is the same vector.
- local nameAttachmentPoint = nil
- local imageAttachmentPoint = nil
- if self:PlayerHasMarineModel(playerEntity) then
- local attachPointOrigin,success = playerEntity:GetAttachPointOrigin("JetPack")
- if success then
- local attachPointCoords = playerEntity:GetAttachPointCoords("JetPack")
- nameAttachmentPoint = attachPointOrigin + 0.00 * attachPointCoords.xAxis +
- -0.35 * attachPointCoords.yAxis +
- -0.37 * attachPointCoords.zAxis
- imageAttachmentPoint = attachPointOrigin + 0.00 * attachPointCoords.xAxis +
- 0.20 * attachPointCoords.yAxis +
- -0.37 * attachPointCoords.zAxis
- end
- elseif self:PlayerHasSkulkModel(playerEntity) then
- local attachPointOrigin,success = playerEntity:GetAttachPointOrigin("Bone_Tongue")
- if success then
- end
- elseif self:PlayerHasLerkModel(playerEntity) then
- local attachPointOrigin,success = playerEntity:GetAttachPointOrigin("Head_Tongue_02")
- if success then
- end
- elseif self:PlayerHasFadeModel(playerEntity) then
- local attachPointOrigin,success = playerEntity:GetAttachPointOrigin("fade_tongue2")
- if success then
- end
- elseif self:PlayerHasGorgeModel(playerEntity) then
- local attachPointOrigin,success = playerEntity:GetAttachPointOrigin("Head")
- if success then
- end
- elseif self:PlayerHasEggModel(playerEntity) then
- local attachPointOrigin,success = playerEntity:GetAttachPointOrigin("target")
- if success then
- end
- end
- //anyone serious about messing with attachment points can maintain their sanity with this
- //vector debug stuff. The code for these is here: http://pastebin.com/8jjwcCeH
- DrawVectorPointBig(nameAttachmentPoint, white)
- DrawVectorPointOnGround(nameAttachmentPoint,playerEntity:GetOrigin().y, white)
- DrawVectorPointBig(imageAttachmentPoint, orange)
- DrawVectorPointOnGround(imageAttachmentPoint,playerEntity:GetOrigin().y, orange)
- //DrawVectorPointHuge(playerEntity:GetOrigin())
- //DrawVectorPointHuge(playerEntity:GetEyePos())
- return nameAttachmentPoint,imageAttachmentPoint
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement