I have this strange issue what I have come across before but cannot recall the reason or fix but when I add this code,
[lua]function GM:PlayerSpawn(ply)
ply.SpawnProt = true
ply:SetColor(0, 255, 0, 140)
if ply:Team() == 1 then ply:RemoveAllItems()
else
//temp weapons
ply:RemoveAllItems()
ply:GiveAmmo(999,"SMG1")
ply:GiveAmmo(9,"Grenade")
ply:GiveAmmo(999,"Pistol")
ply:Give("weapon_crowbar")
ply:Give("weapon_frag")
ply:Give("weapon_deagle")
ply:Give("weapon_ak47")
end
timer.Simple(10, function()
ply.SpawnProt = false
ply:SetColor(0, 0, 0, 255)
end)
end
[/lua]
Everyone ingame has a grey model, no skin, no animation, the weapon is always in the crouch area, any ideas?
First, wrap your code in [lua] tags.
Second, you aren't setting the model for the players anywhere.
The issue is still there despite using the PlayerSetModel hook and setting the model.
Set the team to something other than TEAM_SPECTATOR/TEAM_UNASSIGNED
[QUOTE=Amokov;32355993]Set the team to something other than TEAM_SPECTATOR/TEAM_UNASSIGNED[/QUOTE]
Team is set to 1 on initial spawn, that is enough right? It still persists.
[lua]
function GM:PlayerInitialSpawn(ply)
ply:SetTeam(1)//Set to alchemists on inital spawn
if !ply.GM then ply.GM = {} end //make sure it exists
ply.LabsSpawned={0,0,0,0,0} //fire, earth, water, air, lab
timer.Simple(0.1, function() ply:RemoveAllItems() end)
ply:SetWalkSpeed(170)
ply:SetRunSpeed(250)
ply:SetCrouchedWalkSpeed(0.5)
ply:SetJumpPower(170)
end
[/lua]
You should actually probably set the team in PlayerSpawn, but the reason you're getting those models is because you are overriding Gamemode.PlayerSpawn which is automatically calling Gamemode.PlayerSetModel in the base gamemode.
Add [lua]
hook.Call("PlayerSetModel", GAMEMODE, ply)
[/lua]
or
[lua]
GAMEMODE:PlayerSetModel(ply)
[/lua]
somewhere in your PlayerSpawn hook.
[QUOTE=leiftiger;32356129]You should actually probably set the team in PlayerSpawn, but the reason you're getting those models is because you are overriding Gamemode.PlayerSpawn which is automatically calling Gamemode.PlayerSetModel in the base gamemode.
Add [lua]
hook.Call("PlayerSetModel", GAMEMODE, ply)
[/lua]
or
[lua]
GAMEMODE:PlayerSetModel(ply)
[/lua]
somewhere in your PlayerSpawn hook.[/QUOTE]
Thank you, worked.
Sorry, you need to Log In to post a reply to this thread.