Get a variable in a filterscript from gamemode
#1

Hello.

I've got some variable in a gamemod. How can I get this variable in the filterscript?

Sorry for my poor English. =)
Reply
#2

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

I'll give you an example. Let's say you have the variable for the admin level in the gamemode so add a public function and return the level:
pawn Код:
// it's just an example:
forward ReturnAdminLevel(playerid);
public ReturnAdminLevel(playerid)
{
    return Player_Admin[playerid];
}
now in the filterscript, you need to call the public function and CallRemoteFunction returns what the public functions returns too.
pawn Код:
new admin_level = CallRemoteFunction("ReturnAdminLevel", "i", playerid);
and you got the value of the variable.
Reply
#3

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)