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)