init.sqf or initplayerlocal.sqf

4 posts in this topic

Can someone tell me the difference in these two (init.sqf and initplayerlocal.sqf)?  I'm assuming they are both executed by the client and not the server but I don't know which one of these is the best place to put the execvm.

I modified a login rewards script from ETG_login_reward (andrew_s90) and login_rewards (sir_joker).  The current state is that the script saves namespace variables to track login and uses exile player rewards scripts (andrew_s90) to reward players. This works great as long as I don't restrict reward givers to UIDs.  Now Andrew_s90 provided a way for the rewards givers to be system like event, dms_mission, etc.  However logic dictates that in order for me to use the system as the reward giver, I will need to execute the script server side and not client side.  Currently, the rewards giver is always the client UID if I put it in either of the two files mentioned in the title of the post.  So I'm assuming that neither the init.sqf nor the initplayerlocal.sqf will do what I need it to do.

But I figured I would ask the people that have done this way more than myself.  So I suppose I have two questions:

1.  If I keep things the way they are, which of the two inits is the best place execute the script?

2.  If I decide to modify the script to run server side and use database table to store the variables instead of profilenamespace, would I have to make it an addon?  And how would I trigger it based on a UID login? 

Share this post

Link to post
Share on other sites
On 11/17/2018 at 3:30 PM, kuplion said:

Init: Everything runs it.

InitPlayerLocal: The player / client runs it.

InitServer: The server runs it.

I mean to be more specific...

Init: ...Everything runs it...

InitPlayerLocal: Players / HC / and SOME TIMES server runs it.

InitServer: Only the server runs.

  • Like 1

Share this post

Link to post
Share on other sites

Thanks for the replies.  I have it in initplayerlocal and is working fine for now.  Just have to convert it to save the variables in the db instead of profilenamespace.  Too many ways to exploit login rewards with different profiles.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.