How to lock a filterscript
#2

To check a players info from a filterscript ( which is what you need to do to lock it to certain players ) there are two methods you could use.

1.PVars - which can be set in the gamemode and accessed from a filterscript.
eg:
pawn Код:
//gamemode
SetPVarInt(playerid,"faction",PlayerInfo[playerid][pMember]);

//in FS
if(GetPVarInt(playerid,"faction") == 2 //or whatever
{
     //do stuff here
}
another way would be to put a function in the gamemode and call it from the filterscript
eg
pawn Код:
//in gamemode
forward ReturnPlayerFaction(playerid);
public ReturnPlayerFaction(playerid)
{
     return PlayerInfo[playerid][pFaction];
}

//in the filterscript
new faction = CallRemoteFunction("ReturnPlayerFaction","d",playerid);
if(faction == 2)
{
     //do stuff here
}
Reply


Messages In This Thread
How to lock a filterscript - by ZoinoZ88 - 05.02.2011, 00:50
Re: How to lock a filterscript - by Rachael - 05.02.2011, 01:09
Re: How to lock a filterscript - by ZoinoZ88 - 05.02.2011, 01:30
Re: How to lock a filterscript - by Rachael - 05.02.2011, 01:41

Forum Jump:


Users browsing this thread: 1 Guest(s)