SteamID Specific PlayerModel

I’m trying to get a code done where I’m the only person on my server as male_09.
(It’s TTT so default are CS:S PlayerModels.)

This is what I tried to do but it failed. I have a feeling that everything’s wrong. :downs:

[lua]function SetPlayerModel( ply )
if( ply:SteamID() = “STEAM_0::***” ) then
ply:SetModel( “models/humans/Group03/male_09.mdl” )
end
end
hook.Add( “PlayerSpawn”, SetSpecialModel )[/lua]

The name of your function should be SetSpecialModel.

And for comparison, you use ==, not =. The = character is for assigning.

This is the code I’m using now:

[lua]function SetSpecialModel( ply )
if( ply:SteamID() == “STEAM_0:0:17665709” ) then
ply:SetModel( “models/humans/Group03/male_09.mdl” )
end
end
hook.Add( “PlayerSpawn”, SetSpecialModel )[/lua]Still doesn’t make me male09…

Also, say I wanted to make a Donator/admin only weapon… Why wouldn’t this code work?
[lua]function SetDonatorWeapon( ply )
if( ply:IsUserGroup( “superadmin” ) then
ply:Give( “weapon_ttt_mp5” )
end
end
hook.Add( “PlayerSpawn”, SetDonatorWeapon )[/lua]

Hook them to PlayerSetModel and PlayerLoadout respectively.

Like this?

[lua]function SetDonatorWeapon( ply )
if( ply:IsUserGroup( “superadmin” ) ) then
ply:Give( “weapon_ttt_mp5” )
end
end
hook.Add( “PlayerLoadout”, SetDonatorWeapon )[/lua]
[lua]function SetSpecialModel( ply )
if( ply:SteamID() == “STEAM_0:0:17665709” ) then
ply.SetModel( “models/humans/Group03/male_09.mdl” )
end
end
hook.Add( “PlayerSetModel”, SetSpecialModel )[/lua]

**EDIT: **Neither work… Ugh this is getting annoying.

maybe not ply.SetModel but PlayerSetModel and not ply:Give, PlayerLoadout?

Nope, this just does NOT want to work… Maybe the directories are wrong?

It’s a colon, not a period - ply:SetModel.

Also you are doing this for another gamemode, meaning player models might be handled in different areas leaving your code only useful until then.

[lua]
function SetOwnersModel(pl)
if pl:SteamID() == “SteamID_Here” then
pl:SetModel(“ModelHere”)
end
end
hook.Add(“PlayerSpawn”, “OwnersModel”, SetOwnersModel)
[/lua]

[lua]
function SetDonatorsWeapon(pl)
if pl:IsUserGroup(“superadmin”) then
pl:Give(“weapon_ttt_mp5”)
end
end
hook.Add(“PlayerLoadout”, “DonatorsWeapon”, SetDonatorsWeapon)
[/lua]

I changed the values you set up to change. Still doesn’t work. -_-
I’ll give better details for better answers (Not that this one was bad.)

The server I’m running is a TTT server, a few custom weapons.
I’m putting the lua files in directory “lua/autorun/server”.

Does TTT have something to do with the player model change? Does it always force a terrorist model? If so, how can this lua file override TTT’s model script?
I know it can be done. I’ve seen an admin on another TTT server have a male08 model, some even have Police models. (They ignore my requests for help D:)

TTT from just playing it sets player models to all terrorists, for gameplay benefit. The idea is to not be able to say “the rebel is the traitor” and similar phrases. As for your primary weapon, I’ve seen in ZS that giving players unregistered weapons(or not coded into the gamemode) results in problems, namely lack of getting the weapon.

I have the mp5 coded into the gamemode. I know about SWEPs themself, just not anything else. :3

Try both on PlayerLoadout and are you sure that it is “superadmin” and not “SuperAdmin” or “Super Admin” ? Spaces and capitalizations matter.