26.07.2012, 17:09
If you want something such as /set [optionhere] [playerid] [amount], you could do something like this (untested, just an example):
pawn Code:
CMD:set(playerid,params[])
{
new option[24], targetid, Float:parameter;
if(sscanf(params, "s[24]", option))
{
SendClientMessage(playerid, -1, "Usage: /set [option]");
SendClientMessage(playerid, -1, "Available Options: Health, Armour");
return 1;
}
if(!strcmp(option, "Health", true))
{
if(sscanf(params, "s[24]uf", option, targetid, parameter)) return SendClientMessage(playerid, -1, "Usage: /set health [playerid/partofname] [amount]");
SetPlayerHealth(targetid, parameter);
}
if(!strcmp(option, "Armour", true))
{
if(sscanf(params, "s[24]uf", option, targetid, parameter)) return SendClientMessage(playerid, -1, "Usage: /set armour [playerid/partofname] [amount]");
SetPlayerArmour(targetid, parameter);
}
else return SendClientMessage(playerid, -1, "Invalid option!");
return 1;
}