AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   variables questions (https://forums.alliedmods.net/showthread.php?t=84282)

click0r 01-23-2009 16:07

variables questions
 
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.

Lebson506th 01-23-2009 17:48

Re: variables questions
 
This is a SourceMod forum.

You need to ask about AMX Mod X scripting in the AMX Mod X section.

click0r 01-24-2009 01:21

Re: variables questions
 
sorry, but someone moved to right forum

IneedHelp 01-24-2009 01:39

Re: variables questions
 
The name is on the variable 'sName', try with that.


All times are GMT -4. The time now is 01:44.

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