SA-MP Forums Archive
Read variables from gamemode - 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: Read variables from gamemode (/showthread.php?tid=476034)



Read variables from gamemode - BlueBaron - 16.11.2013

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.


Re: Read variables from gamemode - xVIP3Rx - 16.11.2013

Use properties
sorce


Re: Read variables from gamemode - EvanA - 16.11.2013

[Deleted]


Re: Read variables from gamemode - Ada32 - 16.11.2013

here's a very detailed answer -> https://sampforum.blast.hk/showthread.php?tid=198893


AW: Read variables from gamemode - Skimmer - 16.11.2013

Hello. You can create a public function on your gamemode, which returns the variable.

Here's an example.
pawn Код:
forward ReturnAdminLevel(playerid);
public ReturnAdminLevel(playerid)
{
    return pInfo[playerid][AdminLevel];
}
Then use this function to save the value in a variable.

https://sampwiki.blast.hk/wiki/CallRemoteFunction


Re: Read variables from gamemode - Pottus - 16.11.2013

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)


Re: Read variables from gamemode - BlueBaron - 16.11.2013

Thanks for the suggestions. In the end, I decided to make all of it an include. It will be easier for me.