View Full Version : Read variables from gamemode

16/11/2013, 11:30 AM
Well, for instance I'm creating a filterscript which requires some global variables and functions, from the server gamemode. My question is, how can I link those variables with the filterscript. For example, use "PlayerInfo[targetid][pSex]" from the gamemode to the filterscript, without altering/changing a lot of stuff in the gamemode. And if possible, give a more detailed answer.

Edit: I also require to link an enumerator.

16/11/2013, 11:33 AM
Use properties
sorce (http://forum.sa-mp.com/showpost.php?p=1964264&postcount=8)

16/11/2013, 11:33 AM

16/11/2013, 01:37 PM
here's a very detailed answer -> http://forum.sa-mp.com/showthread.php?t=198893

16/11/2013, 01:57 PM
Hello. You can create a public function on your gamemode, which returns the variable.

Here's an example.
forward ReturnAdminLevel(playerid);
public ReturnAdminLevel(playerid)
return pInfo[playerid][AdminLevel];

Then use this function to save the value in a variable.


16/11/2013, 01:59 PM
That is how I would do it Skimmer but I'm sure someone will suggest "use PVars" which is a bad idea (If you hold any standards)

16/11/2013, 06:45 PM
Thanks for the suggestions. In the end, I decided to make all of it an include. It will be easier for me. :)