30.08.2012, 18:04
i use ppc Cmds So here is a Cmd from ppc Also i want it to be level 1 Admin
Cmd:
Cmd:
pawn Код:
// Gives the player the cash he requests
COMMAND:cash(playerid, params[])
{
new Amount, Msg[128];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/cash", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 4
if (APlayerData[playerid][PlayerLevel] >= 4)
{
if (sscanf(params, "i", Amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/cash <amount>\"");
else
{
// Check if the player gave himself too much at once
if (Amount > 10000000)
{
// Inform the player and quit the command
SendClientMessage(playerid, 0xFF0000AA, "You cannot give yourself more than 10M at once");
return 1;
}
// Reward the player (give cash and points)
RewardPlayer(playerid, Amount, 0);
format(Msg, 128, "You have earned $%i", Amount);
SendClientMessage(playerid, 0x00FF00AA, Msg);
}
}
else
return 0;
}
else
return 0;
return 1;
}