Using database enums from GM inside an FS
#1

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?
Reply
#2

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.
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)