PDA

View Full Version : Read variables from gamemode


BlueBaron
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.

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

EvanA
16/11/2013, 11:33 AM
[Deleted]

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

Skimmer
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.

http://wiki.sa-mp.com/wiki/CallRemoteFunction

Pottus
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)

BlueBaron
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. :)