Calling a public in a Filterscript from a Gamemode, possible?
#1

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.
Reply
#2

No.
Reply
#3

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

Damn. Okay.

Would be alot easyer if it was possible but ok.

Thanks for the info.
Reply
#5

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

Use CallRemoteFunction: https://sampwiki.blast.hk/wiki/CallRemoteFunction
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)