• Call Serverside functions using net.SendToServer()?
    4 replies, posted
Hello again, I am back with another problem. I am trying to switch the players team through a derma menu, which is of course clientside, the only way that I know it works is by making the player run a console command to join the team when a DButton is pressed. But of course that command can just be typed in the console and allow the player to go to that team whenever they want. So I am trying to call the team switch function with net.SendToServer() but it is not working: My Clientside Derma: [CODE] SwitchTeam.DoClick = function() net.Start( "go_team1" ) net.SendToServer() end[/CODE] Serverside: [CODE] util.AddNetWorkString( "go_team1" ) net.Receive("go_team1", GoTeam1 ) // GoTeam1 is a function that I have already made and I know it works.[/CODE] The error I receive is this: [IMG]http://puu.sh/73rwQ.png[/IMG] It makes out that it is something to do with the function, yet the function works fine when called via console command. Any help would be appreciated, thanks.
Ply isnt defined. Net.receive(length, ply) is the args it receives. I suggest using the 2nd arg
What is GoTeam1's parameters?
[QUOTE=Bo98;43983606]What is GoTeam1's parameters?[/QUOTE] It is ( ply ) [editline]20th February 2014[/editline] [QUOTE=zerothefallen;43983599]Ply isnt defined. Net.receive(length, ply) is the args it receives. I suggest using the 2nd arg[/QUOTE] Oh shit I just added change GoTeam1( ply ) to GoTeam1( length, ply ) That was too simple, thanks very much
snips
Sorry, you need to Log In to post a reply to this thread.