Jump to content

Agreement / Contract API (NodeJS) 1.0.0

   (1 review)

About This File

Hi guys!

A function works when the contract is accepted by everyone.

I tried to write similar to root's inventory-api.

Contact me! If you want to change something 

Please Download from Github.

https://github.com/QueennN/AgreementAPI

 
!!!VERY IMPORTANT NOTICE!!!
Using player.id is not a reliable way while the agreement is active(not signed), the player can leave the game and player.id can be changed.
For this reason, you should use a unique id. For example, database id.My database is player.charid.You have to change player.charid .!!!!
 
You can change 'playerLogin' event too. Its my auth event.
 

EXAMPLE:

addAgreement("key","name","desc",acceptFunction()=

aS.addAgreement('spawn',"Spawn ","perfect desc",(data,chars)=>{
          for(let cid in chars){
                let players=mp.players.toArray().filter(p=>p.charid==cid)
                for(let i in players){
                      players[i].position=data     
               }  
        }
})

player.createAgreement("key" , [player-uniqid list] , time , data)

 player.createAgreement("spawn",[player.charid],55,{x:56,y:98,z:100})

player.signAgreement(activeAgreemnts Index,decision) 

player.signAgreement(index,true)

User Feedback

Recommended Comments

If your gamemode doesnt support multi-account .You can use  player.rgscId  for uniq id .If your gamemode supports multi-account You need to use your uniq character id like a db id.You have to make this decision.

Link to comment
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
×
×
  • Create New...