Sub-Command (playerid or range)?
#6

Unable to test this as I'm not near my computer, but how you could do it is as SickAttack suggested.
Which I believe can go as followed:

Code:
new selector[2], target, weapon, Float:radius;

if (sscanf(params, "s[2]ii", selector, target, weapon)
{
	if (!strcmp(selector, "-r") // checks if the selector that was given equals -r
	{
		radius = float(target); // turns the integer (target) into a float
		//insert radius give code
	}
	else if (!strcmp(selector, "-p") // checks if the selector that was given equals -p
	{
		//insert player give code
	}
	else // if neither of the checks were positive
	{
		//sytax message (/giveweapon [-p / -r] [target] [weapon])
	}
}
else
{
	//sytax message (/giveweapon [-p / -r] [target] [weapon])
}
Only problem with this code is that you can't use a player's name, only their ID. But besides that it should work in theory.
Reply


Messages In This Thread
[SOLVED] Sub-Command (playerid or range)? - by RayBiH - 18.12.2016, 18:35
Re: Sub-Command (playerid or range)? - by Konstantinos - 18.12.2016, 18:40
Re: Sub-Command (playerid or range)? - by RayBiH - 18.12.2016, 18:59
Re: Sub-Command (playerid or range)? - by SickAttack - 18.12.2016, 19:09
Re: Sub-Command (playerid or range)? - by Konstantinos - 18.12.2016, 19:15
Re: Sub-Command (playerid or range)? - by Duco - 19.12.2016, 09:27
Re: Sub-Command (playerid or range)? - by RayBiH - 19.12.2016, 10:17
Re: Sub-Command (playerid or range)? - by OneDay - 19.12.2016, 10:56

Forum Jump:


Users browsing this thread: 1 Guest(s)