General > Developers Corner
TTT Setting ulx usergroups to custom player models.
(1/1)
PeddleMe:
Hi, I'm not entirely sure if I'm posting in the correction section, sorry if I am. :/
I've been trying to set ulx groups to have custom player models on spawn for TTT. So far this is all I've got:
--- Quote --- if ply:IsUserGroup("owner") then
return "models/player/superheroes/superman.mdl"
end
--- End quote ---
I placed this into lua/autorun/server
JamminR:
Is that the _only_ code you have?
Is that code in a function?
Does TTT call whatever function you have, and set the model of the player depending on if it's returned.
The way you have it set is literally returning "/model/.../path/etc" to whatever is calling it.
If that code is just in a file, it's likely erroring out on server start.
PeddleMe:
--- Quote from: JamminR on March 02, 2017, 08:07:49 PM ---Is that the _only_ code you have?
Is that code in a function?
Does TTT call whatever function you have, and set the model of the player depending on if it's returned.
The way you have it set is literally returning "/model/.../path/etc" to whatever is calling it.
If that code is just in a file, it's likely erroring out on server start.
--- End quote ---
Yes this is the only code I have.
It's not in a function.
The only model related stuff I have are;
shared.lua
--- Quote ----- Everyone's model
local ttt_playermodels = {
Model("models/player/gman_high.mdl")
};
function GetRandomPlayerModel()
return table.Random(ttt_playermodels)
end
local ttt_playercolors = {
all = {
COLOR_GREEN
},
serious = {
COLOR_DGREEN
}
};
--- End quote ---
player.lua
--- Quote ---hook.Call("PlayerSetModel", GAMEMODE, ply)
--- End quote ---
player_ext.lua
--- Quote ---function plymeta:SpawnForRound(dead_only)
hook.Call("PlayerSetModel", GAMEMODE, self)
--- End quote ---
Those last three quotes are from the original TTT files with only the first one being slightly edited. I'm posting these because when I tried to add functions (a couple of hours ago, I get kept getting errors from these lines; forgot what functions I was adding because I gave up at some point :/ ).
An Error Has Occurred!
array_keys(): Argument #1 ($array) must be of type array, null given
[0] Board index
Go to full version