01.05.2011, 00:52
pawn Code:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(dargrana, 8, cmdtext);
return 0;
}
dcmd_dargrana(playerid, params[])
{
new
giveplayerid,
grana;
if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xB4B5B7FF, "Usage: /dargrana [playerid] [dinheiro]");
else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, " ID INVБLIDO !");
else if (grana < 1 && grana > 100000)) SendClientMessage(playerid, 0xC2A2DAAA, " Os valores devem estar entre R$ 1 e R$ 100.000");
else
{
GivePlayerMoney(giveplayerid, grana);
}
return 1;
}