Good morning, I don't know much about sourcespawn, therefore I don't know how to solve this question, I would like to be able to add commands that only administrators are allowed to common players through a menu, I was looking at pan0s' post on how to add commands that do not have the option to give but it is not very clear to me.
give the following example:
PHP Code:
if(StrEqual(item, "extinguisher"))
{
CheckHavingGunToUseItem(client, item);
ExternalCmd(client, "sm_giveext", 1);
}
else if(IndexOf(item, 32, "airstrike", 9) != -1)
{
int target = 0;
/* Create an Airstrike. Usage:
// sm_strikes <#userid|name> <type:
1=Aim position.
2=On position>
OR vector position <X> <Y> <Z> <angle>
*/
char crosshair[] = "crosshair";
char position[] = "position";
if(IndexOf(item, 32, crosshair, sizeof(crosshair)) != -1) target = 1;
else if (IndexOf(item, 32, position, sizeof(position)) != -1) target = 2;
ExternalCmd(client, "sm_strikes", target);
}
//<---------- Add an else if(){} here , refer to above. IndexOf(item, 32, "airstrike", 9) != -1 means the item name that has "airstrike", -1 = don't have
else CheatCommand(client, "give", item);
This same one from Silvers plugin - Extinguisher & Flamethrower, which is an administrator command, Thanks in advance for the help.