View Single Post
Flynn
Senior Member
Join Date: Sep 2009
Old 09-05-2009 , 02:44   Re: modifying sm_beacon
Reply With Quote #7

No, the number of arguments is the incorrect number of arguments being passed, not 'args' (which is just a variable called args and isn't actually 'arguments' per se).

Replace Command_Beacon with this and recompile.
Code:
public Action:Command_Beacon(client, args)
{
	if (args < 2)
	{
		ReplyToCommand(client, "[SM] Usage: sm_beacon <#userid|name> <set>");
		return Plugin_Handled;
	}

	decl String:arg[65];
	decl bool:set;
	
	GetCmdArg(2, arg, sizeof(arg));
	set = StringToInt(arg);

	GetCmdArg(1, arg, sizeof(arg));
	

	decl String:target_name[MAX_TARGET_LENGTH];
	decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
	
	if ((target_count = ProcessTargetString(
			arg,
			client,
			target_list,
			MAXPLAYERS,
			COMMAND_FILTER_ALIVE,
			target_name,
			sizeof(target_name),
			tn_is_ml)) <= 0)
	{
		ReplyToTargetError(client, target_count);
		return Plugin_Handled;
	}
	
	for (new i = 0; i < target_count; i++)
	{
		PerformBeacon(client, target_list[i], set);
	}
	
	if (tn_is_ml)
	{
		ShowActivity2(client, "[SM] ", "%t", "Toggled beacon on target", target_name);
	}
	else
	{
		ShowActivity2(client, "[SM] ", "%t", "Toggled beacon on target", "_s", target_name);
	}
	
	return Plugin_Handled;
}
Helps if I actually make use of the updated function.
Flynn is offline
Send a message via MSN to Flynn Send a message via Skype™ to Flynn