How to get the player who executed concommand?

Ok here is my problem.
In the clientside file i use this to call a function in serverside:



ply:ConCommand( "sg_seat" )


And this is the function which i call:



function sg_seat( ply )


end
concommand.Add( "sg_seat", sg_seat )


Now my problem is that the ply argument in the function dont represent the player who executed the ConCommand function.
How can i get the player exectued this concommand?

What does does the ply argument represent then? Is ply LocalPlayer()? Are you sure the concommand is created serverside?

Dont know exactly what it represents. It seems to be that it represents every player.
The function spawns a seat. And it should only spawn the seat by the player which is calling function. But every player spawns a seat if someone uses command.
And no the ply is not a local player. It represents the player which writting the chatcommand on clientside. On serverside it should be the same but it isnt.
And yes, the concommand is created in server init.

If you wanted the player to execute it themselves, then you wouldn’t need anything done in cl_init.lua.

Post the rest of your code and maybe one of us can solve your unusual dilemma.

You’re using a concommand for chat commands? What?

You should just have something like this serverside.

[lua]hook.Add( “PlayerSay”, “Chathook”, function( ply, msg )
if ( msg == “!spawnchair” ) then
spawnChair( ply )
end
end )[/lua]

I now filter the chatcommands on serverside and it works fine. Thanks a lot =)