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

So hello there, i would like to know how to make functions from filescripts to be available only for cops, but i don't know how, and can not find no where anything about it So i would like help with this
Reply
#2

Nobody knows?
Reply
#3

If the functions are related to your gamemode, you cant just use it like that. I think.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)