SA-MP Forums Archive
CallRemoteFunction - Just need a run down - 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)
+--- Thread: CallRemoteFunction - Just need a run down (/showthread.php?tid=375141)



CallRemoteFunction - Just need a run down - Deal-or-die - 05.09.2012

Filterscript
pawn Код:
public OnFilterScriptInit()
{  
    CallRemoteFunction("GetAdminLevel", PlayerInfo[playerid][pAdmin]);
Gamemode
pawn Код:
public GetAdminLevel(playerid)
{
    PlayerInfo[playerid][pAdmin] = PlayerInfo[playerid][pAdmin];
    return 1;
}
I know I have done the stupidest mistake I just can't place it... :P

Cheers in advance.


Re: CallRemoteFunction - Just need a run down - playbox12 - 05.09.2012

I don't get it, do you want it to return the admin level for the specific player?

pawn Код:
public GetAdminLevel(playerid)
{
    return PlayerInfo[playerid][pAdmin];
}



Re: CallRemoteFunction - Just need a run down - Deal-or-die - 05.09.2012

Yea I am trying to get the admin level used in the gamemode into the filterscript for commands as such.
Example
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 4)
{
    SendClientMes....



Re: CallRemoteFunction - Just need a run down - leonardo1434 - 05.09.2012

use this one to call the function and playbox's code.
pawn Код:
CallRemoteFunction("GetAdminLevel", "i",playerid);



Re: CallRemoteFunction - Just need a run down - Deal-or-die - 05.09.2012

Ahh wicked cheers.

But how does The CallRemoteFunction save the result? or where?


Re: CallRemoteFunction - Just need a run down - leonardo1434 - 05.09.2012

Test by yourself and see how it works.
pawn Код:
public OnFilterScriptInit()
{
   new anyvalue = 100,returnedvalue;
   returnedvalue = CallRemoteFunction("something", "i",anyvalue);
   printf(#%d,returnedvalue);
   return 1;
}
forward something(otherthing);
public something(otherthing)
{
    return otherthing + otherthing;
}



Re: CallRemoteFunction - Just need a run down - Deal-or-die - 05.09.2012

Hahaha Nice examples. :P

Cheers all for your help, Sorry about my retardedness :P