You can find money code samples by looking others plugin source code (*.sp)
I made this quick
PHP Code:
public void OnPluginStart()
{
RegConsoleCmd("sm_mycommand", command_callback);
}
public Action command_callback(int client, int arg)
{
// no arguments passed through command
if(arg < 1)
{
ReplyToCommand(client, "[SM] Usage: sm_mycommand <value>");
return Plugin_Handled;
}
// client index 0 = command used from server console
if(client == 0)
{
ReplyToCommand(client, "[SM] Use this command in-game");
return Plugin_Handled;
}
// get command first argument
char text[20];
GetCmdArg(1, text, sizeof(text));
int value = StringToInt(text) // convert text to integer
int m_iAccount = GetEntProp(client, Prop_Send, "m_iAccount"); // player money
PrintToChat(client, "Your money %i, your first argument %i, final ammount %i", m_iAccount, value, m_iAccount+value);
SetEntProp(client, Prop_Send, "m_iAccount", m_iAccount+value);
return Plugin_Handled; // Prevent "unknow command" error in console
}
__________________