Filterscript
#1

Hello guys if i have a filter script and has a variable for example called :
pawn Код:
IsAfk[playerid]=0;
How can i pass that variable to the game mode?
Reply
#2

pVars are used to get data from other filterscripts/files.
For variables you have to merge your filterscript into Gamemode.
Reply
#3

so i either have to use SetPVar or merge the filter script into the game mode?
Reply
#4

You can put it in a function, like
Код:
forward IsAFK( playerid );
public IsAFK( playerid )
    return IsAfk[ playerid ];
And in GM you can use it like
Код:
CallRemoteFunction( "IsAFK", "i", playerid );
To set it's value from GM you can do this:
Код:
forward SetAFK( playerid, value );
public SetAFK( playerid, value )
    return IsAfk[ playerid ] = value;
And in GM you can use it like
Код:
CallRemoteFunction( "SetAFK", "ii", playerid, 1 );
But it's easier with PVars.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)