SA-MP Forums Archive
FS's and GM's communicating - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: FS's and GM's communicating (/showthread.php?tid=120913)



FS's and GM's communicating - Mattjones17 - 13.01.2010

Hi,
I remember that there was a way to, under certain circumstances, get a gamemode to communicate with an FS.

For example, if the GM connects to MySQL, you could get the Fs to check permissions via the GM.

I don't know how to do this. Does anyone know
Thanks
Matt


Re: FS's and GM's communicating - Joe Staff - 14.01.2010

Simplest way I can think of is to use CallRemoteFunction.

Example:
OnGameMode
pawn Code:
enum Information
{
  cash,
  admin,
  level,
}
new pInfo[MAX_PLAYERS][Information];
public OnPlayerConnect(playerid)
{
  CallRemoteFunction("GetVars","iiii",playerid,pInfo[playerid][cash],pInfo[playerid][admin],pInfo[playerid][level]);
  return 1;
}
On Filterscript
pawn Code:
forward GetVars(playerid,cash,admin,level);
enum Information
{
  cash,
  admin,
  level,
}
new pInfo[MAX_PLAYERS][Information];
public GetVars(playerid,cash,admin,level)
{
  pInfo[playerid][cash]=cash;
  pInfo[playerid][admin]=admin;
  pInfo[playerid][level]=level;
}