SA-MP Forums Archive
CallRemoteFunction - 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 (/showthread.php?tid=654446)



CallRemoteFunction - KinderClans - 28.05.2018

Hello, i'm developing a minigames server. I've the core as filterscript (which handles registration, login, commands etc). I need some clarifications about CallRemoteFunction.

The minigames are a separate gamemodes. In the main FS i've the row "TotalGamesPlayed" which shows how many games a player has played, and i can increase it when i want.

Player[playerid][TotalGamesPlayed] ++;

My question is, how to use call remote function in a minigame gamemode to execute the code above?

Thanks.


Re: CallRemoteFunction - FailerZ - 28.05.2018

PHP код:
//In the main filterscript
forward UpdateGamesPlayed(playerid);
public 
UpdateGamesPlayed(playerid)
{
    
Player[playerid][TotalGamesPlayed]++;
    return 
1;
}
//In the gamemode
CMD:execute(playeridparams[])
{
    
CallRemoteFunction("UpdateGamesPlayed""i"playerid);
    return 
1;

Код:
Result: Now the value of Player[playerid][TotalGamesPlayed] which is located in the main filterscript increments by one



Re: CallRemoteFunction - KinderClans - 28.05.2018

Thank you. Repped.