Liberty Unleashed

Scripting => Script Help => Topic started by: Motley on April 27, 2016, 12:48:54 am

Title: onClientRequestSpawn
Post by: Motley on April 27, 2016, 12:48:54 am
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Events/Player/onClientRequestSpawn (http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Events/Player/onClientRequestSpawn)

For the first time in a long time I could use actual Script help.

How would I actually read if a player is not registered or logged in client side?

Title: Re: onClientRequestSpawn
Post by: rwwpl on April 27, 2016, 08:27:49 am
Use CallClientFunc

Something like this:

Server-side:

Code: [Select]
function onPlayerJoin(p)
{
if (Reg[p.ID] == true) CallClientFunc(p,"testscript/testscript.nut","IsRegister",true); //send to client infomation about register status
}

Client-side

Code: [Select]
Register <- false;

function IsRegister(bool) Register = bool;

function onClientRequestSpawn(c)
{
if (Register == true) return 1; //can spawn
else return 0; //can't spawn
}
Title: Re: onClientRequestSpawn
Post by: Motley on April 27, 2016, 01:48:45 pm
Thanks rwwpl! I will continue to play with this  :)