Need a way to do this
#1

Alright so hi.

I am making as much as possibly dynamic gamemode in pawn. Meaning, you can create teams in game, shops etc. etc. etc. Everything besides commands is dynamic (even the admin command permissions are dynamic, you can change them with a simple command)

Now im facing quite a problem.

Im converting some code to make the scripting doable directly from admin UCP. Aka create new teams from UCP and such.

Now in order to apply changes I have to reload the SQL, well the table that I have altered from in game to apply changes.

Now I am thought of some ways to do it but Im not quite sure if its the best

A: Have a timer running on X minutes to scan for changes
- The timer will check if there are more rows than with the last check, if there are reload the table.

B: Rcon GMX
- Well this can be executed from an outside source.

Now the problem with A is reloading too many tables therefore Id have different timers running on different intervals to restart the tables if there are changes
Problem with B, its an entire server restart.

Any suggestions?

Basically everything is stored inside SQL. Meaning teams, permissions, pickups, shops, checkpoints etc. etc. etc. etc.
Reply
#2

Why do you reload the SQL database?

You can apply those in game changes when you update anything in game, be it commands, when the command is executed, update the in game changes and database.
Reply
#3

Well since its coming from a PHP script from a website and such, Id need to load those new rows and the only way to detect if there were new rows is by having something that will go every X minutes to check
Reply
#4

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Well since its coming from a PHP script from a website and such, Id need to load those new rows and the only way to detect if there were new rows is by having something that will go every X minutes to check
Instead of checking it through a timer for X milliseconds on a repeat; Use callbacks which are frequently used by players and are mandatory. Like for dynamic teams, check if there is any new team under OnPlayerRequestClass or however you use it, maybe checking before showing a team dialog.
Reply
#5

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Instead of checking it through a timer for X milliseconds on a repeat; Use callbacks which are frequently used by players and are mandatory. Like for dynamic teams, check if there is any new team under OnPlayerRequestClass or however you use it, maybe checking before showing a team dialog.
Thats actually indeed better. Thanks a lot bud
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)