Problema meniu [rezolvat!]

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
KronoS eXtream
Fost administrator
Fost administrator
Posts: 4380
Joined: 02 Apr 2009, 18:18
Detinator Steam: Da
Reputatie: Fost administrator
Fost detinator Zombie-Land.eXtream.Ro
Contribuitor
Fost Scripter eXtreamCS
Dezvoltator al listei de seriozitate eXtreamCS
Location: Bucharest
Has thanked: 543 times
Been thanked: 820 times
Contact:

28 Aug 2010, 19:04

Salut!Am facut un meniu ce este printat la fiecare spawn.Problema este ca este printat doar la primul spawn.Dupa aceea nu mai apare si primesc erorile:

Code: Select all

L 08/28/2010 - 19:44:34: Invalid menu id 3(4)
L 08/28/2010 - 19:44:34: [AMXX] Displaying debug trace (plugin "zd_classes_2_0.amxx")
L 08/28/2010 - 19:44:34: [AMXX] Run time error 10: native error (native "menu_display")
L 08/28/2010 - 19:44:34: [AMXX]    [0] zd_classes_2_0.sma::zombie_class_menu (line 42)
L 08/28/2010 - 19:44:34: [AMXX]    [1] zd_classes_2_0.sma::ham_PlayerSpawned (line 28)

Code: Select all

public ham_PlayerSpawned(id)
{
    if (!is_user_alive(id) || !cs_get_user_team(id))
        return

    if(cs_get_user_team(id) == CS_TEAM_T)
    {
        zombie_class_menu(id)
    }
}

public zombie_class_menu(id)
{
        menu_display(id, menu_class, 0)
}

public plugin_cfg()
{
        menu_class = menu_create("Blabla", "zombie_menu_handler")
        menu_additem(menu_class, "Blabla", "1", 0)
        menu_additem(menu_class, "Blabla", "2", 0)
        menu_setprop(menu_class, MPROP_EXIT, MEXIT_ALL)
}

public zombie_menu_handler(id, menu_class, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu_class)
        return PLUGIN_HANDLED
    }
    new data[6], iName[64]
    new access, callback
    menu_item_getinfo(menu_class, item, access, data,5, iName, 63, callback)
    new key = str_to_num(data)
    switch(key)
    {
        case 1:
        {
            blalablalbla
        }
        case 2:
        {
            blalablalbla
        }
    }
    menu_destroy(menu_class)
    return PLUGIN_HANDLED
}
Nu efectuez tranzactii pe mess, skype etc. Aveti grija la indivizii care se dau drept mine!
Nu mai ofer suport asa ca nu imi mai trimiteti mesaje in legatura cu asta!


Zombie Plague Shade 1.2-debug1 [with Item Limiter] (12 September 2015) - Bombardier Branch
User avatar
pigmy
Membru, skill +2
Membru, skill +2
Posts: 594
Joined: 14 Dec 2007, 17:49
Detinator Steam: Da
CS Status: PEACE!
Has thanked: 2 times
Been thanked: 23 times

31 Aug 2010, 02:27

Vezi...
| Afiseaza codul
public ham_PlayerSpawned(id)
{
	if (!is_user_alive(id) || !cs_get_user_team(id))
	return PLUGIN_CONTINUE

	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		zombie_class_menu(id)
	}
}

public zombie_class_menu(id)
{
	menu_display(id, menu_class, 0)
}

public plugin_cfg()
{
        new menu_class = menu_create("Blabla", "zombie_menu_handler")

        menu_additem(menu_class, "Blabla", "1", 0)
        menu_additem(menu_class, "Blabla", "2", 0)

        menu_setprop(menu_class, MPROP_EXIT, MEXIT_ALL)
}

public zombie_menu_handler(id, menu_class, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu_class)

		return PLUGIN_HANDLED
	}

	new data[6], iName[64], access, callback
	menu_item_getinfo(menu_class, item, access, data,5, iName, 63, callback)
	new key = str_to_num(data)
	switch(key)
	{
		case 1:
		{
 			blalablalbla

			key = (0<<1|1<<1|1<<2)
		}
        	case 2:
        	{
			blalablalbla

			key = (0<<1|1<<1|1<<2)
		}
	}

	menu_destroy(menu_class)
	return PLUGIN_HANDLED
}
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests