Jump to content
Tory Xiao

Run script for first time in server players

Recommended Posts

What should I do to run certain scripts on new players like add starting money or welcome intro when they connected to the server for the first time? I tried this but it seems not working. 

 

Share this post


Link to post
Share on other sites

do you plan to give some more information?

58 minutes ago, Tory Xiao said:

it seems not working

with that kind of info i ve to ask first if u plugged the power plug in...

Share this post


Link to post
Share on other sites
On 8/5/2021 at 11:49 PM, sarogahtyp said:

do you plan to give some more information?

with that kind of info i ve to ask first if u plugged the power plug in...

Sorry about that..... Im running an A3Wasteland server, I just want to know is there a script that can identify if a player is the first time in the server

Share this post


Link to post
Share on other sites

In initPlayerLocal.sqf:

if (isNil {profileNameSpace getVariable "myHolyServerVar"} ) then {
    profileNameSpace setVariable ["myHolyServerVar",getPlayerUID player];
    hint "welcome for your 1st time here";
};



in initPlayerServer.sqf:
 

if (isNil "identifiedPlayers") then {identifiedPlayers = []};
identifiedPlayers pushBackUnique getPlayerUID (_this #0);

 

identifiedplayers is local to server. You can script for newbies on server before pushback if the player UID is not yet inside the array.

If you want to keep this array on server, not reset at server start, you can use also the profileNameSpace of the server. 

Share this post


Link to post
Share on other sites
19 hours ago, pierremgi said:

In initPlayerLocal.sqf:


if (isNil {profileNameSpace getVariable "myHolyServerVar"} ) then {
    profileNameSpace setVariable ["myHolyServerVar",getPlayerUID player];
    hint "welcome for your 1st time here";
};



in initPlayerServer.sqf:
 


if (isNil "identifiedPlayers") then {identifiedPlayers = []};
identifiedPlayers pushBackUnique getPlayerUID (_this #0);

 

identifiedplayers is local to server. You can script for newbies on server before pushback if the player UID is not yet inside the array.

If you want to keep this array on server, not reset at server start, you can use also the profileNameSpace of the server. 

Thanks a lot, I'll try it

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

×