How to make FS available only for specific factions?
#4

Well, maybe but you'd have to use CallRemoteFunction, SQL, player Teams (GetPlayerTeam), or PVars

CallRemoteFunction calls a function from other loaded script and returns the value it returns.

You could do

pawn Код:
forward GetCopLevel(playerid);
public GetCopLevel(playerid)
{
      return GetPVarInt(playerid,"CopLevel"); // or whatever you use to store levels.
}
In the main gamemode then in the filterscript

pawn Код:
new coplevel = CallRemoteFunction("GetCopLevel", "i", playerid);
Which would also be unaccurate under heavy script processing load.

--------

With Teams you face the anti team kill problems but if that's okay for you then that would be the easiest solution.

---------

With SQL it would be pretty easy, connecting both scripts to the same DB.

---------

Alternatively and the easiest way I remembered while writting this is PVars.

PVars are shared between gamemodes and filterscripts loaded.

If you load a player's faction in the main gamemode, by saving it with PVars you can access that very same PVar in any filterscript you load.
Reply


Messages In This Thread
How to make FS available only for specific factions? - by LazyGamer99 - 30.01.2014, 17:21
Re: How to make FS available only for specific factions? - by LazyGamer99 - 01.02.2014, 08:56
Re: How to make FS available only for specific factions? - by rakshith122 - 01.02.2014, 09:22
Re: How to make FS available only for specific factions? - by CuervO - 01.02.2014, 11:06

Forum Jump:


Users browsing this thread: 1 Guest(s)