02.06.2016, 12:16
You can either use:
but that will not ignore the case of the letters and neither will show the usage for heal option. Another way is this:
pawn Код:
if (!sscanf(params, "'heal'f", amount)
{
// code..
}
PHP код:
if (isnull(params))
{
ShowSyntax(playerid, "/aevent <Option>");
SCM(playerid, COLOR_SERVER, "Options: {FFFFFF}Heal, Armour, GiveGun, Disarm, Respawn,(Un)Freeze, Repair, Nos");
return 1;
}
if (!strcmp(params, "heal", true, 4))
{
new
Float: amount;
if (sscanf(params[4], "f", amount)) return print("/aevent heal <Value>");
foreach(new i : Player)
{
if (FindNear(60.0, playerid, i))
{
SetPlayerHealth(i, amount);
format(strglobal, sizeof(strglobal), "(Admin Event) {FFFFFF}%s set your health to %.1f", GetName(playerid), amount);
SCM(i, COLOR_LIGHTRED, strglobal);
}
}
}
else if (!strcmp(params, "armour", true, 6))
{
new
Float: amount;
if (sscanf(params[6], "f", amount)) return print("/aevent armour <Value>");
// code..
}
// rest of them..
else
{
ShowSyntax(playerid, "/aevent <Option>");
SCM(playerid, COLOR_SERVER, "Options: {FFFFFF}Heal, Armour, GiveGun, Disarm, Respawn,(Un)Freeze, Repair, Nos");
}