Author Topic: onClientRequestSpawn  (Read 1150 times)

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
onClientRequestSpawn
« on: April 27, 2016, 01:48:54 am »
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?


rwwpl

  • Full Member
  • ***
  • Posts: 126
  • Karma: +18/-6
  • LU-DM Team
    • View Profile
    • LU-DM Team
Re: onClientRequestSpawn
« Reply #1 on: April 27, 2016, 09: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
}

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: onClientRequestSpawn
« Reply #2 on: April 27, 2016, 02:48:45 pm »
Thanks rwwpl! I will continue to play with this  :)

 

© Liberty Unleashed Team.