Help with scripting please
Started by Tragen47




1 posts in this topic
Tragen47


15 posts 8 threads Joined: Jan 2017
01-27-2017, 04:05 AM -
#1
Hello, I have started hosting one server and I want to make some scripts for it.
I made folder, put there server.cs, namecheck.txt and description.txt.
I wanted to make script that player when spawns (not connects) automatically inputs console command.
I do script like this:

function Client::GameConnection::onClientEnterGame()
{
    echo(%client, "AWS_bindtexture()");
}

But, unfortunately it doesn't work. What did I do wrong and how to make script always running when someone spawns in game?????????
Crown
<><

145 posts 6 threads Joined: Jan 2017
01-27-2017, 01:25 PM -
#2
You can't directly run eval on clients that connect to your server. The only way to run functions on the client from the server is if it's a clientCmd. AWS_bindTexutre(); is from the cinema mod I'm assuming, and is not a clientCmd so they have to enter it manually.

This won't work eitherway though as the client class is called GameConnection so it would be function GameConnection::onClientEnterGame(%client). You didn't include the %client variable so it would be nothing in this case.


Forum Jump: