Ok, I got the code of wiki, Anyways,
I want the id who got sent the money to recieve a message,
Код:
Admin Torran has set your cash to [amount]
So i used a string,
pawn Код:
format(string, sizeof(string), "Admin %s has set your cash to %s", name, amount);
The name bit works alright ingame but the amount bit just displays this:
[img width=1024 height=768]/imageshack/img80/271/samp001ai.png[/img]
Ive never used a string for anything besides the players name,
So i know ive done something wrong,
Btw the command works fine,
Full code:
pawn Код:
dcmd_givecash(playerid, params[])
{
new
giveplayerid,
amount;
if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash [playerid/partname] [amount]");
else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
GivePlayerMoney(giveplayerid, amount);
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s has set your cash to %s", name, amount);
SendClientMessage(giveplayerid, 0xFFFF00AA, string);
}
return 1;
}