01.10.2011, 18:13
how to create a command /otvorisef and random GiveMoney... please tell me
CMD:givemoney(playerid, params[])
{
if (!IsPlayerAdmin(playerid)) return SendClientMessage(byplayerid, 0xFF0000FF, "Only admins can use this command!");
{
new
playerid,
amount;
if (!sscanf(params, "ui", playerid, amount)) return SendClientMessage(byplayerid, 0xFFFFFFFF, "Usage: /givemoney <player ID/name> <amount>");
{
if (playerid = INVALID_PLAYER_ID) return SendClientMessage(byplayerid, 0xFF0000FF, "Error: no such player");
{
new
message[40];
GivePlayerMoney(playerid, amount);
format(message, sizeof(message), "You got $%d from admin!", amount);
SendClientMessage(playerid, 0x00FF00FF, message);
}
}
}
return 1;
}
CMD:otvorisef(playerid, params[])
{
new randommoney= 1000+random(5000);
GivePlayerMoney(playerid, randommoney);
return 1;
}