Player executing console command?

I was wondering, I have been trying to create a spawnicon that sets the model of the person in the game. And so when I started with this I thought that I couldn’t use any serverside functions (obviously because it is in the cl_init.lua file), So I created a console command to do it in the serverside lua files, and just call it in the cl_init.lua file)

So Basically, on my serverside files i have a table of all the models, and then on the clientside i do,

RunConsoleCommand(“setmodels”, selection)

and so in the serverside it calls:


And to my point, I was wondering, is there a variable for the triggering player? Because I don’t quite know what to do in that situation.

Here’s how it should go : [lua]

function SetTheModel(ply,command,args)

concommand.Add(“setmodels”, SetTheModel)


RunConsoleCommand(“setmodels”, selection)[/lua]