05.02.2011, 01:09
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:
another way would be to put a function in the gamemode and call it from the filterscript
eg
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
}
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
}