Raised This Month: $ Target: $400
 0% 

Help getting server initiate commands on players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Jenkins
AlliedModders Donor
Join Date: Jul 2011
Old 09-28-2011 , 04:39   Help getting server initiate commands on players
Reply With Quote #1

Okay, I got a little menu where you can choose the slay player, everything works fine except to the slaying where nothing happens. Its exactly the same with ban too. I will give you my execute handle in the menu.

Slay handle:
Code:
public HandleSlay(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new data[6], name[64]
	new access, callback
	
	menu_item_getinfo (menu, item, access, data, 5, name, 63, callback)
	new szSlayHim = str_to_num ( data )
	
	new szName[33]
	get_user_name(id, szName, 32)
	get_user_name(szSlayHim, szPlayerName, 32)
	get_user_authid(szSlayHim, authid, 31)
	
	ColorChat(0, GREY, "%s ^4%s^3 has slayed ^4%s^3!", prefix, szName, szPlayerName)
	server_cmd("amx_slay %s", szPlayerName)

	
	return PLUGIN_CONTINUE
}
Ban handle:
Code:
public HandleBan(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new data[6], name[64]
	new access, callback
	
	menu_item_getinfo (menu, item, access, data, 5, name, 63, callback)
	new szBanHim = str_to_num ( data )
	
	new szName[33]
	get_user_name(id, szName, 32)
	get_user_name(szBanHim, szPlayerName, 32)
	get_user_authid(szBanHim, authid, 31)
	
	ColorChat(0, GREY, "%s ^4%s^3 has banned ^4%s^3! ^4(30 min)^3", prefix, szName, szPlayerName)
	server_cmd("amx_ban ^"30^" ^"%s^" ^"Breaking a rule^"", authid)

	
	return PLUGIN_CONTINUE
}
Jenkins is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode