SA-MP Forums Archive
Calling a public in a Filterscript from a Gamemode, possible? - 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: Calling a public in a Filterscript from a Gamemode, possible? (/showthread.php?tid=146193)



Calling a public in a Filterscript from a Gamemode, possible? - juuleman - 06.05.2010

Hey All,

I got a question. Is it possible to call a public thats in a Filterscript from a Gamemode??
Like 'test()' in my gamemode but the 'public test() is in a Filterscript.

Please help.
Thanks.


Re: Calling a public in a Filterscript from a Gamemode, possible? - [MWR]Blood - 06.05.2010

No.


Re: Calling a public in a Filterscript from a Gamemode, possible? - Jochemd - 06.05.2010

No. It's impossible for pawno to know if the filterscript or gamemode will be loaded together.


Re: Calling a public in a Filterscript from a Gamemode, possible? - juuleman - 06.05.2010

Damn. Okay.

Would be alot easyer if it was possible but ok.

Thanks for the info.


Re: Calling a public in a Filterscript from a Gamemode, possible? - Kyosaur - 06.05.2010

It's completely possible, i dont know what you to are on.

Use CallRemoteFunction: https://sampwiki.blast.hk/wiki/CallRemoteFunction


Re: Calling a public in a Filterscript from a Gamemode, possible? - Simon - 06.05.2010

Yes it's possible.

Use CallRemoteFunction.. so for example you could do:

pawn Код:
// In your filterscript
public MyFunction(playerid) {
  if (!IsPlayerConnected(playerid))
    return 1;
  else return 0;
}

// In your gamemode
stock MyFunction(playerid)
  return CallRemoteFunction("MyFunction", "i", playerid);
You can test whether the public function exists or not by using the "funcidx" function. If this function returns -1 then the function does not exist.