Read variables from gamemode
#1

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

Use properties
sorce
Reply
#3

[Deleted]
Reply
#4

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

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
Reply
#6

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)
Reply
#7

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


Forum Jump:


Users browsing this thread: 2 Guest(s)