read a gamemode variable from filterscript
#1

as the title said, how to read "PlayerInformation[playerid][whatever]" which exists in the gamemode, from a filterscript?
Reply
#2

Just use single line :-
pawn Код:
#define "/gamemodes/yourgamemode.pwn"
Reply
#3

This should work

In the gamemode you put this
pawn Код:
forward GetAdminFS(playerid);
public GetAdminFS(playerid) {
    return PlayerInformation[playerid][whatever];
}
in the filterscript you use https://sampwiki.blast.hk/wiki/CallRemoteFunction
Reply
#4

Tutorial: Getting your filterscripts and gamemodes to share information
Reply
#5

You need to make some functions in your gamemode to return values like this.

pawn Код:
forward GetPlayerWhatever(playerid);
public GetPlayerWhatever(playerid) { return PlayerInformation[playerid][whatever]; }
Now create an include for your filterscripts like this

pawn Код:
#define GetPlayerWhatever(%0) CallRemoteFunction("GetPlayerWhatever", "i", %0)
If anyone suggests to use PVars don't the tradeoff will most likely be in favor of CallRemoteFunction() even though it is slower using PVars overall will most certainly be slower besides they make some really ugly looking code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)