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=357303)
CallRemoteFunction -
lewismichaelbbc - 06.07.2012
In my gamemode:
Код:
forward Admin_GetPlayerMoney(playerid);
public Admin_GetPlayerMoney(playerid)
{
return APlayerData[playerid][PlayerMoney];
}
In my filterscript:
Код:
// This function is used to set the player's money
INT_GivePlayerMoney(playerid, Money)
{
// Setup local variables
new Success;
// Try to call the external function to get the player's money (used to get the serversided money for this player)
Success = CallRemoteFunction("Admin_GivePlayerMoney", "ii", playerid, Money);
// The external function returned "0" as the function is not used in another script
if (Success == 0)
{
GivePlayerMoney(playerid, Money); // Use the normal money (client-sided money)
SendClientMessage(playerid, 0xFFFFFFFF, "The money system didnt work correctly. Please contact an admin IMMEDIATLY");
}
}
The problem is, is that every time this function is called, it always does success = 0 which means its not workin. Anyone know how i can fix this?
Re: CallRemoteFunction -
Roko_foko - 06.07.2012
can you show us your Admin_GivePlayerMoney function?