CallRemoteFunction
#1

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

can you show us your Admin_GivePlayerMoney function?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)