Using variables from other scripts.
#1

Basically, I've got a registration script which I plan to put a 'VIP' type system into. However, I do plan to put in special buildings etc. that are only accessible by VIPs - now, for me to check if they are a VIP, I'd have to read from the file using INI as the variables of course that hold whether they are a VIP are stored in the filterscript.

In terms of getting around this, I can only think of the file reading method, however I usually only update the files using INI when they disconnect - the problem this poses is that if I make them a VIP while they are connected, it will stay in a variable that's created for every player and it will not be updated in the file until they disconnect and it writes.

As a solution I could make it save automatically after a command that edits the game-file, however I'd rather not.

Any clues? I'd also like to avoid joining the filterscript to the gamemode - worst case scenario I'll put all of the VIP system related code within the registration system, but I would of liked to of kept it within the gamemode just so I'd be able to keep all the vehicles (specifically the VIP ones) inside the gamemode.
Reply
#2

This is what PVars are used for. They're cross script.

https://sampwiki.blast.hk/wiki/SetPVarInt
https://sampwiki.blast.hk/wiki/GetPVarInt
Reply
#3

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
This is what PVars are used for. They're cross script.

https://sampwiki.blast.hk/wiki/SetPVarInt
https://sampwiki.blast.hk/wiki/GetPVarInt
You legend.

I'll look into them and hopefully they sort the issue out - thanks a bunch.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)