I tried searching and didnt find anything.. Is there any way I can have a serverside script that gives a player an admin specific player model?
Thanks
[lua]hook.Add("PlayerSpawn", "AdminModelThing", function(ply)
if !ply:IsAdmin() then return end
ply:SetModel("player/police.mdl") -- or whatever you want
end)[/lua]
that goes in the server.cfg right?
[QUOTE=BOOFY;21875449]that goes in the server.cfg right?[/QUOTE]
go to lua/autorun/server/ make a .lua file there and put that code in it and restart your server.
I don't have a lua folder, i'm putting it in my zombie master server :) shall i make one?
[QUOTE=BOOFY;21875580]I don't have a lua folder, i'm putting it in my zombie master server :) shall i make one?[/QUOTE]
You gotta be kidding.. :doh:
Am i being a idiot then? can i not change my playermodel in this mod as an admin? It's all hosted locally so all the folders are easier to access i guess.
[QUOTE=BOOFY;21875680]Am i being a idiot then? can i not change my playermodel in this mod as an admin? It's all hosted locally so all the folders are easier to access i guess.[/QUOTE]
Garry Implented Lua to Garrysmod, You cant use Lua on other source games.
-facepalm-
Use both:
[lua]local function modelthing(ply)
if !ply:IsAdmin() then return end
ply:SetModel("models/player/police.mdl") -- or whatever you want
end
hook.Add("PlayerSpawn", "AdminModelThing", modelthing)
hook.Add("PlayerSetModel", "AdminModelThing", modelthing)[/lua]
[QUOTE=BOOFY;21875449]that goes in the server.cfg right?[/QUOTE]
[QUOTE=BOOFY;21875580]I don't have a lua folder, i'm putting it in my zombie master server :) shall i make one?[/QUOTE]
:wtc:
thanks a lot, ill try it out this evening
Can I ask why you did..
[lua]!ply:IsAdmin()[/lua]
Instead of..
[lua]ply:IsAdmin()[/lua]
Just wondering for reference.
! means not.
Sorry, you need to Log In to post a reply to this thread.