17.02.2014, 15:58
pawn Код:
CMD:give(playerid, params[])
{
new membername, code, amount;
if(sscanf(params, "uii", membername, code, amount))
{
SendClientMessage(playerid, COLOR_ORANGE, "[Set Player]{FFFFFF} /give[playerid] [code] [amount]");
SendClientMessage(playerid, COLOR_GREY, "1) Health 2) Armour 3) Weapon");
return 1;
}
if(!IsPlayerConnected(membername)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player");
switch (code)
{
case 1:
{
SetPlayerHealth(membername, amount);
SendClientMessage(playerid, COLOR_GREEN, "Succeed");
}
case 2:
{
SetPlayerArmour(membername, amount);
SendClientMessage(playerid, COLOR_GREEN, "Succeed");
}
case 3:
{
// weapon..
}
default: SendClientMessage(playerid, COLOR_GREY, "Invalid option -> 1) Health 2) Armour 3) Weapon");
}
return 1;
}