Jump to content
Sign in to follow this  
Linker Split

Spawn a PLAYER via script from server, not from client - Possible?

Recommended Posts

Hello all again

what basically I'm asking, is if is there a way to spawn a player (not a unit) that got a unique UID, into the server, via script?

I have some function (DBLoadPlayer, DBSavePlayer, DBServerSaveplayer and so on) that are called when a client is connecting to the game.

Could I call these function directly from a script?

Share this post


Link to post
Share on other sites

Try.

player/init.sqf

waitUntil {
sleep 0.1;

!(isNull player)
};

playerUid = getPlayerUID player;

publicVariableServer "playerUid";

playerUid = nil;

server/init.sqf

"playerUid" addPublicVariableEventHandler {
_player = objNull;

_playerUid = _this select 1;

{if ((getPlayerUID _x) == _playerUid) exitWith {_player = _x}} forEach playableUnits;

_player setPos desiredPosition;
};

Share this post


Link to post
Share on other sites
Try.

player/init.sqf

waitUntil {
sleep 0.1;

!(isNull player)
};

playerUid = getPlayerUID player;

publicVariableServer "playerUid";

playerUid = nil;

mmm problem is that I have no player... XD

It's not a physical player playing wrom around the world, still I want to emulate this

Share this post


Link to post
Share on other sites
Well, I think it's impossible. (

That's the final answer - you can't emulate a human person loggin in unless you actually do it.

You could, however, setup a client from your end to do it, I mean if you setup your server as a dedicated one, whenever you connect you should be able to trigger those functions.

If you know what parameters those functions expect, you can call them manually, like you can do with any other function.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×