01.03.2014, 16:07
Hi, is there a script to givecash through dialogue??
COMMAND:givemoney(playerid, params[])
{
if (IsPlayerAdmin(playerid))
{
new
toplayerid, // the player we want to give money to
amount;
// extracting player's ID and amount from params
if (!sscanf(params, "ii", toplayerid, amount))
{
if (toplayerid != INVALID_PLAYER_ID)
{
new
message[40];
GivePlayerMoney(toplayerid, amount);
format(message, sizeof(message), "You got $%d from admin!", amount);
SendClientMessage(toplayerid, 0x00FF00FF, message);
}
else SendClientMessage(playerid, 0xFF0000FF, "That player is not connected");
}
else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney <playerid> <amount>");
}
else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!");
return 1;
}