Raised This Month: $ Target: $400
 0% 

variables questions


Post New Thread Reply   
 
Thread Tools Display Modes
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
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 01-23-2009 , 17:48   Re: variables questions
Reply With Quote #2

This is a SourceMod forum.

You need to ask about AMX Mod X scripting in the AMX Mod X section.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
click0r
Junior Member
Join Date: Aug 2005
Old 01-24-2009 , 01:21   Re: variables questions
Reply With Quote #3

sorry, but someone moved to right forum
click0r is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 01-24-2009 , 01:39   Re: variables questions
Reply With Quote #4

The name is on the variable 'sName', try with that.
__________________
IneedHelp is offline
Reply



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