Raised This Month: $ Target: $400
 0% 

variables questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
click0r
Junior Member
Join Date: Aug 2005
Old 01-23-2009 , 16:07   variables questions
Reply With Quote #1

Code:
public plugin_init()
{
	/* Menu KS SYSTEM */
	/* Use menu_display(id, mKSSYSTEM, 0) to show the menu to an user. */
	mKSSYSTEM = menu_create("KS SYSTEM", "mh_KSSYSTEM")
	mcbKSSYSTEM = menu_makecallback("mcb_KSSYSTEM")
	menu_additem(mKSSYSTEM, "FORGIVE", "ma_KSSYSTEM", ADMIN_ALL, mcbKSSYSTEM)
	menu_additem(mKSSYSTEM, "KILL", "ma_KSSYSTEM", ADMIN_ALL, mcbKSSYSTEM)
	menu_additem(mKSSYSTEM, "SLAP", "ma_KSSYSTEM", ADMIN_ALL, mcbKSSYSTEM)
	menu_additem(mKSSYSTEM, "GLOW", "ma_KSSYSTEM", ADMIN_ALL, mcbKSSYSTEM)
	menu_additem(mKSSYSTEM, "DISARM", "ma_KSSYSTEM", ADMIN_ALL, mcbKSSYSTEM)
	/* Menu End */
	
}



[..]

public mh_KSSYSTEM(id, menu, item) {
	new temp[32]
	/* This event is called when someone presses a key on this menu */
	new iAccess, iCallback, sData[33], sName[65]
	menu_item_getinfo( menu, item, iAccess, sData, 32, sName, 64, iCallback )
	new iKey = str_to_num ( sData )
	get_user_name(iKey,temp,31)
	switch (item) {
		case 0: { // 1
			client_print(0,3,"[KS SYSTEM] FORGIVE: %s",temp)	
		}
		case 1: { // 2
			client_print(0,3,"[KS SYSTEM] KILL: %s",temp)
			user_kill(id);
		}
		case 2: { // 3
			client_print(0,3,"[KS SYSTEM] SLAP: %s",temp)
		}
		case 3: { // 4
			client_print(0,3,"[KS SYSTEM] GLOW: %s",temp)
		}
		case 4: { // 5
			client_print(0,3,"[KS SYSTEM] DISARM: %s",temp)
		}
	}
}

public ma_KSSYSTEM(id) {

}

public mcb_KSSYSTEM(id, menu, item) {

}



public ksuj(victim, attacker)
{
	menu_display(victim, mKSSYSTEM, 0)
}
how i can use attacker variable in menu?

i trying that:
Code:
           new iAccess, iCallback, sData[33], sName[65]
	menu_item_getinfo( menu, item, iAccess, sData, 32, sName, 64, iCallback )
	new iKey = str_to_num ( sData )
	get_user_name(iKey,temp,31)
but its returning my server name and im sure kser() is calling with good values.

Last edited by click0r; 01-23-2009 at 16:12.
click0r is offline
 


Thread Tools
Display Modes

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 01:44.


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