PDA

View Full Version : Store_GetCredits seems to be broken


CamerDisco
10-19-2016, 13:01
Hi, I'm not writing it on store section, beacuse that section is dead.

I'm trying to use Store_GetCredits

public Action Cmd_sm_customknife(int client, int args)
{
if (client == 0)
{
ReplyToCommand(client, "%t", "Command is in-game only");
return Plugin_Handled;
}
Store_GetCredits(GetSteamAccountID(client), OnGetCreditsComplete, GetClientUserId(client));
}

public void OnGetCreditsComplete(int credits, any data)
{
int client = GetClientOfUserId(data);

if (!client)
{
return;
}
if(credits<3000)
{
PrintToChat(client,"Potrzebujesz 3k");
return;
}
ShowKnifeMenu(client);
}
On compile I'm getting error:
mp.sp(146) : error 100: function prototypes do not match146 line: Store_GetCredits(GetSteamAccountID(client), OnGetCreditsComplete, GetClientUserId(client));This function on store.inc:

/**
* Retrieves the amount of credits that a player currently has.
*
* As with all other store-backend methods, this method is completely asynchronous.
*
* @param accountId The account ID of the player, use Store_GetClientAccountID to convert a client index to account ID.
* @param callback A callback which will be called when the credits amount is loaded.
* @param data Extra data value to pass to the callback.
*
* @noreturn
*/
native Store_GetCredits(accountId, Store_GetCreditsCallback:callback, any:data = 0);