SA-MP Forums Archive
Using database enums from GM inside an FS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Using database enums from GM inside an FS (/showthread.php?tid=380729)



Using database enums from GM inside an FS - HighFlyer - 26.09.2012

Hi there,

I have a truck system in a filterscript, however I am wondering how I can add cash to a players account. The thing is, GivePlayerMoney won't work, because it gives the cash, but then returns the cash to the original state, by taking the information from the column of the gamemode's database.

How can I make it so it adds the cash into Player[playerid][Money] array, in the quickest and most efficient way possible, using a filterscript? Do I have to add all of the enums and MySQL functions into the filterscript as well as the gamemode, or can this be somehow bypassed?


Re: Using database enums from GM inside an FS - Roko_foko - 26.09.2012

I don't get what you actually want. I think the answer may be PlayerVariables (https://sampwiki.blast.hk/wiki/Per-player_variable_system). They are used for exchange variable values between filterscripts and gamemodes.

Each playervariable you can use in Gamemode and in Filterscript.


Re: Using database enums from GM inside an FS - HighFlyer - 26.09.2012

My gamemode saves data into a MySQL database. I want to do the same for a filterscript, but I don't want to have to go through the queries, enums and defines, and all that lot again. Plus, I don't know if two connections are possible? One from a GM and one from an FS.


Re: Using database enums from GM inside an FS - Sinner - 27.09.2012

Yes 2 connections is possible, you don't even need to use a different handle.