Jailbreak
Help with scripting please - Printable Version

+- Jailbreak (https://draked.me/forum)
+-- Forum: Jailbreak (https://draked.me/forum/forumdisplay.php?fid=1)
+--- Forum: Off Topic (https://draked.me/forum/forumdisplay.php?fid=10)
+--- Thread: Help with scripting please (/showthread.php?tid=69)



Help with scripting please - Tragen47 - 01-27-2017

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?????????


RE: Help with scripting please - Crown - 01-27-2017

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.