Преработка на wepons_menu дава грешка в error.log

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Отговори
Потребителски аватар

Автор на темата
M36
Потребител
Потребител
Мнения: 62
Регистриран: 19 фев 2019, 11:34
Се отблагодари: 7 пъти

Преработка на wepons_menu дава грешка в error.log

Мнение от M36 » 09 май 2019, 13:15

Здрравейте грешката е следната:
L 05/09/2019 - 12:17:34: Start of error session.
L 05/09/2019 - 12:17:34: Info (map "de_kabul32") (file "addons/amxmodx/logs/error_20190509.log")
L 05/09/2019 - 12:17:34: Player 1 is not in game.
L 05/09/2019 - 12:17:34: [AMXX] Displaying debug trace (plugin "weapons_menu.amxx", version "1.0")
L 05/09/2019 - 12:17:34: [AMXX] Run time error 10: native error (native "menu_display")
L 05/09/2019 - 12:17:34: [AMXX] [0] weapons_menu.sma::pishtak (line 190)

Ето и плъгина :

Код: Избери всички

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Guz Menu"
#define VERSION "1.0"
#define AUTHOR "SmirnoffBG"

enum {
	Prim,
	Sec
}

new glavnoto, osnovno, vtorichno, ceni[33]
new user_weps[33][2], bool:give_weapon_onspawn[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	RegisterHam(Ham_Spawn, "player", "ragdane", 1)
	
	register_clcmd("say /guns", "dai_gun")
	register_clcmd("say guns", "dai_gun")
	
	glavnoto = menu_create("[ReaL-TeaM]Menu", "posreshtane")
	menu_additem(glavnoto, "New Guns")
	menu_additem(glavnoto, "Previous Guns")
	menu_additem(glavnoto, "Previous + Save")
	
	osnovno = menu_create("Primary Weapons", "dai_wep")
	menu_additem(osnovno, "AK47"), 		menu_additem(osnovno, "M4A1")
	menu_additem(osnovno, "SG552"), 	menu_additem(osnovno, "AUG")
	menu_additem(osnovno, "Galil"),		menu_additem(osnovno, "Famas")
	menu_additem(osnovno, "Scout"),		menu_additem(osnovno, "AWP \r[$10000]")
	menu_additem(osnovno, "M249"),		menu_additem(osnovno, "M3")
	menu_additem(osnovno, "XM1014"),	menu_additem(osnovno, "MP5 Navy")
	menu_additem(osnovno, "UMP45"),		menu_additem(osnovno, "P90")
	menu_additem(osnovno, "TMP"),		menu_additem(osnovno, "Mac10")
	menu_additem(osnovno, "Go to previous menu")
	
	//Neka tuk sedqt vsi4ki ceni
	ceni[CSW_AWP] = 10000
	
	vtorichno = menu_create("Secondary", "pishtak")
	menu_additem(vtorichno, "\rDeagle")
	menu_additem(vtorichno, "USP")
	menu_additem(vtorichno, "Glock 18")
	menu_additem(vtorichno, "Five Seven")
	menu_additem(vtorichno, "p228")
	menu_additem(vtorichno, "Elite")
	menu_additem(vtorichno, "Go to previous menu")
}

public client_connect(id)
{
	give_weapon_onspawn[id] = false
}

public dai_gun(id)
{
	menu_display(id, glavnoto)
}

public ragdane(id)
{
	if(!is_user_alive(id)) return
	if(give_weapon_onspawn[id])
		Give_Weapons(id, true)
	else
		menu_display(id, glavnoto)
}
public posreshtane(id, menu, item)
{
	switch(item)
	{
		case 0:menu_display(id, vtorichno)
		case 1:Give_Weapons(id, false)
		case 2:Give_Weapons(id, true)
	}
}

Give_Weapons(id, bool:Save)
{
	if(!is_user_alive(id)) return
	new csw_prim = user_weps[id][Prim], csw_sec = user_weps[id][Sec]
	
	strip_user_weapons(id)
	give_item(id, "weapon_knife")
	give_item(id, "weapon_hegrenade")
	
	//if(csw_prim == 0) {menu_display(id, osnovno); 	return;}
	new cena = ceni[csw_prim], cena2 = ceni[csw_sec]
	if(cena > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4primary^3!")
		}else{
			give_user_wep(id, csw_prim)
			cs_set_user_money(id, money - cena, 1)
		}
	} else	give_user_wep(id, csw_prim)
	
	//if(csw_sec == 0)  {menu_display(id, vtorichno); 	return;}
	if(cena2 > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena2)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4secondary^3!")
		} else {
			give_user_wep(id, csw_sec)
			cs_set_user_money(id, money - cena2, 1)
		}
	} else 	give_user_wep(id, csw_sec)
	
	if(Save)give_weapon_onspawn[id] = true
	else	give_weapon_onspawn[id] = false
}

give_user_wep(id, csw)
{
	if(csw == 0) return
	new WeaponName[20]
	get_weaponname(csw, WeaponName, 19)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
}

public dai_wep(id, menu, item)
{
	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)
	
	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'a':switch(name[chara+1])
			{
				case 'k':user_weps[id][Prim] = CSW_AK47
				case 'u':user_weps[id][Prim] = CSW_AUG
				case 'w':user_weps[id][Prim] = CSW_AWP
			}
		case 'm':switch(name[chara+1])
			{
				case 'p':user_weps[id][Prim] = CSW_MP5NAVY
				case 'a':user_weps[id][Prim] = CSW_MAC10
				case '4':user_weps[id][Prim] = CSW_M4A1
				case '3':user_weps[id][Prim] = CSW_M3
				case '2':user_weps[id][Prim] = CSW_M249
			}
		case 's': {if(name[chara+1]== 'g')user_weps[id][Prim] = CSW_SG552 ;else user_weps[id][Prim] = CSW_SCOUT;}
		case 'g': {if(name[chara+1]== 'a')user_weps[id][Prim] = CSW_GALIL ;else {menu_display(id, vtorichno); return;}}
		case 'x':user_weps[id][Prim] = CSW_XM1014
		case 'u':user_weps[id][Prim] = CSW_UMP45
		case 't':user_weps[id][Prim] = CSW_TMP
		case 'f':user_weps[id][Prim] = CSW_FAMAS
		case 'p':user_weps[id][Prim] = CSW_P90
	}
	//menu_display(id, vtorichno)
	Give_Weapons(id, false)
}

public pishtak(id, menu, item)
{
	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)
	
	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'd':user_weps[id][Sec] = CSW_DEAGLE
		case 'u':user_weps[id][Sec] = CSW_USP
		case 'g':{if(name[chara+1]== 'l') user_weps[id][Sec] = CSW_GLOCK18 ;else {menu_display(id, glavnoto); return;}}
		case 'f':user_weps[id][Sec] = CSW_FIVESEVEN
		case 'p':user_weps[id][Sec] = CSW_P228
		case 'e':user_weps[id][Sec] = CSW_ELITE
	}
	menu_display(id, osnovno)
	//Give_Weapons(id, false)
}

Потребителски аватар

OciXCrom TM
Администратор
Администратор
Мнения: 5382
Регистриран: 06 окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 87 пъти
Получена благодарност: 600 пъти
Години: 21
Контакти:

Преработка на wepons_menu дава грешка в error.log

Мнение от OciXCrom TM » 09 май 2019, 17:49

Код: Избери всички

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Guz Menu"
#define VERSION "1.0"
#define AUTHOR "SmirnoffBG"

enum {
	Prim,
	Sec
}

new glavnoto, osnovno, vtorichno, ceni[33]
new user_weps[33][2], bool:give_weapon_onspawn[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)

	RegisterHam(Ham_Spawn, "player", "ragdane", 1)

	register_clcmd("say /guns", "dai_gun")
	register_clcmd("say guns", "dai_gun")

	glavnoto = menu_create("[ReaL-TeaM]Menu", "posreshtane")
	menu_additem(glavnoto, "New Guns")
	menu_additem(glavnoto, "Previous Guns")
	menu_additem(glavnoto, "Previous + Save")

	osnovno = menu_create("Primary Weapons", "dai_wep")
	menu_additem(osnovno, "AK47"), 		menu_additem(osnovno, "M4A1")
	menu_additem(osnovno, "SG552"), 	menu_additem(osnovno, "AUG")
	menu_additem(osnovno, "Galil"),		menu_additem(osnovno, "Famas")
	menu_additem(osnovno, "Scout"),		menu_additem(osnovno, "AWP \r[$10000]")
	menu_additem(osnovno, "M249"),		menu_additem(osnovno, "M3")
	menu_additem(osnovno, "XM1014"),	menu_additem(osnovno, "MP5 Navy")
	menu_additem(osnovno, "UMP45"),		menu_additem(osnovno, "P90")
	menu_additem(osnovno, "TMP"),		menu_additem(osnovno, "Mac10")
	menu_additem(osnovno, "Go to previous menu")

	//Neka tuk sedqt vsi4ki ceni
	ceni[CSW_AWP] = 10000

	vtorichno = menu_create("Secondary", "pishtak")
	menu_additem(vtorichno, "\rDeagle")
	menu_additem(vtorichno, "USP")
	menu_additem(vtorichno, "Glock 18")
	menu_additem(vtorichno, "Five Seven")
	menu_additem(vtorichno, "p228")
	menu_additem(vtorichno, "Elite")
	menu_additem(vtorichno, "Go to previous menu")
}

public client_connect(id)
{
	give_weapon_onspawn[id] = false
}

public dai_gun(id)
{
	menu_display(id, glavnoto)
}

public ragdane(id)
{
	if(!is_user_alive(id)) return
	if(give_weapon_onspawn[id])
		Give_Weapons(id, true)
	else
		menu_display(id, glavnoto)
}
public posreshtane(id, menu, item)
{
	switch(item)
	{
		case 0:menu_display(id, vtorichno)
		case 1:Give_Weapons(id, false)
		case 2:Give_Weapons(id, true)
	}
}

Give_Weapons(id, bool:Save)
{
	if(!is_user_alive(id)) return
	new csw_prim = user_weps[id][Prim], csw_sec = user_weps[id][Sec]

	strip_user_weapons(id)
	give_item(id, "weapon_knife")
	give_item(id, "weapon_hegrenade")

	//if(csw_prim == 0) {menu_display(id, osnovno); 	return;}
	new cena = ceni[csw_prim], cena2 = ceni[csw_sec]
	if(cena > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4primary^3!")
		}else{
			give_user_wep(id, csw_prim)
			cs_set_user_money(id, money - cena, 1)
		}
	} else	give_user_wep(id, csw_prim)

	//if(csw_sec == 0)  {menu_display(id, vtorichno); 	return;}
	if(cena2 > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena2)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4secondary^3!")
		} else {
			give_user_wep(id, csw_sec)
			cs_set_user_money(id, money - cena2, 1)
		}
	} else 	give_user_wep(id, csw_sec)

	if(Save)give_weapon_onspawn[id] = true
	else	give_weapon_onspawn[id] = false
}

give_user_wep(id, csw)
{
	if(csw == 0) return
	new WeaponName[20]
	get_weaponname(csw, WeaponName, 19)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
}

public dai_wep(id, menu, item)
{
	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)

	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'a':switch(name[chara+1])
			{
				case 'k':user_weps[id][Prim] = CSW_AK47
				case 'u':user_weps[id][Prim] = CSW_AUG
				case 'w':user_weps[id][Prim] = CSW_AWP
			}
		case 'm':switch(name[chara+1])
			{
				case 'p':user_weps[id][Prim] = CSW_MP5NAVY
				case 'a':user_weps[id][Prim] = CSW_MAC10
				case '4':user_weps[id][Prim] = CSW_M4A1
				case '3':user_weps[id][Prim] = CSW_M3
				case '2':user_weps[id][Prim] = CSW_M249
			}
		case 's': {if(name[chara+1]== 'g')user_weps[id][Prim] = CSW_SG552 ;else user_weps[id][Prim] = CSW_SCOUT;}
		case 'g': {if(name[chara+1]== 'a')user_weps[id][Prim] = CSW_GALIL ;else {menu_display(id, vtorichno); return;}}
		case 'x':user_weps[id][Prim] = CSW_XM1014
		case 'u':user_weps[id][Prim] = CSW_UMP45
		case 't':user_weps[id][Prim] = CSW_TMP
		case 'f':user_weps[id][Prim] = CSW_FAMAS
		case 'p':user_weps[id][Prim] = CSW_P90
	}
	//menu_display(id, vtorichno)
	Give_Weapons(id, false)
}

public pishtak(id, menu, item)
{
	if(!is_user_connected(id))
	{
		return
	}

	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)

	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'd':user_weps[id][Sec] = CSW_DEAGLE
		case 'u':user_weps[id][Sec] = CSW_USP
		case 'g':{if(name[chara+1]== 'l') user_weps[id][Sec] = CSW_GLOCK18 ;else {menu_display(id, glavnoto); return;}}
		case 'f':user_weps[id][Sec] = CSW_FIVESEVEN
		case 'p':user_weps[id][Sec] = CSW_P228
		case 'e':user_weps[id][Sec] = CSW_ELITE
	}
	menu_display(id, osnovno)
	//Give_Weapons(id, false)
}

Потребителски аватар

Автор на темата
M36
Потребител
Потребител
Мнения: 62
Регистриран: 19 фев 2019, 11:34
Се отблагодари: 7 пъти

Преработка на wepons_menu дава грешка в error.log

Мнение от M36 » 09 май 2019, 18:53

OciXCrom написа:
09 май 2019, 17:49

Код: Избери всички

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Guz Menu"
#define VERSION "1.0"
#define AUTHOR "SmirnoffBG"

enum {
	Prim,
	Sec
}

new glavnoto, osnovno, vtorichno, ceni[33]
new user_weps[33][2], bool:give_weapon_onspawn[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)

	RegisterHam(Ham_Spawn, "player", "ragdane", 1)

	register_clcmd("say /guns", "dai_gun")
	register_clcmd("say guns", "dai_gun")

	glavnoto = menu_create("[ReaL-TeaM]Menu", "posreshtane")
	menu_additem(glavnoto, "New Guns")
	menu_additem(glavnoto, "Previous Guns")
	menu_additem(glavnoto, "Previous + Save")

	osnovno = menu_create("Primary Weapons", "dai_wep")
	menu_additem(osnovno, "AK47"), 		menu_additem(osnovno, "M4A1")
	menu_additem(osnovno, "SG552"), 	menu_additem(osnovno, "AUG")
	menu_additem(osnovno, "Galil"),		menu_additem(osnovno, "Famas")
	menu_additem(osnovno, "Scout"),		menu_additem(osnovno, "AWP \r[$10000]")
	menu_additem(osnovno, "M249"),		menu_additem(osnovno, "M3")
	menu_additem(osnovno, "XM1014"),	menu_additem(osnovno, "MP5 Navy")
	menu_additem(osnovno, "UMP45"),		menu_additem(osnovno, "P90")
	menu_additem(osnovno, "TMP"),		menu_additem(osnovno, "Mac10")
	menu_additem(osnovno, "Go to previous menu")

	//Neka tuk sedqt vsi4ki ceni
	ceni[CSW_AWP] = 10000

	vtorichno = menu_create("Secondary", "pishtak")
	menu_additem(vtorichno, "\rDeagle")
	menu_additem(vtorichno, "USP")
	menu_additem(vtorichno, "Glock 18")
	menu_additem(vtorichno, "Five Seven")
	menu_additem(vtorichno, "p228")
	menu_additem(vtorichno, "Elite")
	menu_additem(vtorichno, "Go to previous menu")
}

public client_connect(id)
{
	give_weapon_onspawn[id] = false
}

public dai_gun(id)
{
	menu_display(id, glavnoto)
}

public ragdane(id)
{
	if(!is_user_alive(id)) return
	if(give_weapon_onspawn[id])
		Give_Weapons(id, true)
	else
		menu_display(id, glavnoto)
}
public posreshtane(id, menu, item)
{
	switch(item)
	{
		case 0:menu_display(id, vtorichno)
		case 1:Give_Weapons(id, false)
		case 2:Give_Weapons(id, true)
	}
}

Give_Weapons(id, bool:Save)
{
	if(!is_user_alive(id)) return
	new csw_prim = user_weps[id][Prim], csw_sec = user_weps[id][Sec]

	strip_user_weapons(id)
	give_item(id, "weapon_knife")
	give_item(id, "weapon_hegrenade")

	//if(csw_prim == 0) {menu_display(id, osnovno); 	return;}
	new cena = ceni[csw_prim], cena2 = ceni[csw_sec]
	if(cena > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4primary^3!")
		}else{
			give_user_wep(id, csw_prim)
			cs_set_user_money(id, money - cena, 1)
		}
	} else	give_user_wep(id, csw_prim)

	//if(csw_sec == 0)  {menu_display(id, vtorichno); 	return;}
	if(cena2 > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena2)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4secondary^3!")
		} else {
			give_user_wep(id, csw_sec)
			cs_set_user_money(id, money - cena2, 1)
		}
	} else 	give_user_wep(id, csw_sec)

	if(Save)give_weapon_onspawn[id] = true
	else	give_weapon_onspawn[id] = false
}

give_user_wep(id, csw)
{
	if(csw == 0) return
	new WeaponName[20]
	get_weaponname(csw, WeaponName, 19)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
}

public dai_wep(id, menu, item)
{
	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)

	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'a':switch(name[chara+1])
			{
				case 'k':user_weps[id][Prim] = CSW_AK47
				case 'u':user_weps[id][Prim] = CSW_AUG
				case 'w':user_weps[id][Prim] = CSW_AWP
			}
		case 'm':switch(name[chara+1])
			{
				case 'p':user_weps[id][Prim] = CSW_MP5NAVY
				case 'a':user_weps[id][Prim] = CSW_MAC10
				case '4':user_weps[id][Prim] = CSW_M4A1
				case '3':user_weps[id][Prim] = CSW_M3
				case '2':user_weps[id][Prim] = CSW_M249
			}
		case 's': {if(name[chara+1]== 'g')user_weps[id][Prim] = CSW_SG552 ;else user_weps[id][Prim] = CSW_SCOUT;}
		case 'g': {if(name[chara+1]== 'a')user_weps[id][Prim] = CSW_GALIL ;else {menu_display(id, vtorichno); return;}}
		case 'x':user_weps[id][Prim] = CSW_XM1014
		case 'u':user_weps[id][Prim] = CSW_UMP45
		case 't':user_weps[id][Prim] = CSW_TMP
		case 'f':user_weps[id][Prim] = CSW_FAMAS
		case 'p':user_weps[id][Prim] = CSW_P90
	}
	//menu_display(id, vtorichno)
	Give_Weapons(id, false)
}

public pishtak(id, menu, item)
{
	if(!is_user_connected(id))
	{
		return
	}

	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)

	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'd':user_weps[id][Sec] = CSW_DEAGLE
		case 'u':user_weps[id][Sec] = CSW_USP
		case 'g':{if(name[chara+1]== 'l') user_weps[id][Sec] = CSW_GLOCK18 ;else {menu_display(id, glavnoto); return;}}
		case 'f':user_weps[id][Sec] = CSW_FIVESEVEN
		case 'p':user_weps[id][Sec] = CSW_P228
		case 'e':user_weps[id][Sec] = CSW_ELITE
	}
	menu_display(id, osnovno)
	//Give_Weapons(id, false)
}
Мериси много оци вечарта ще го тествам и ще пиша!

Потребителски аватар

PreDatoR
Потребител
Потребител
Мнения: 21
Регистриран: 15 дек 2018, 13:23

Преработка на wepons_menu дава грешка в error.log

Мнение от PreDatoR » 09 май 2019, 22:10

OciXCrom написа:
09 май 2019, 17:49

Код: Избери всички

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Guz Menu"
#define VERSION "1.0"
#define AUTHOR "SmirnoffBG"

enum {
	Prim,
	Sec
}

new glavnoto, osnovno, vtorichno, ceni[33]
new user_weps[33][2], bool:give_weapon_onspawn[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)

	RegisterHam(Ham_Spawn, "player", "ragdane", 1)

	register_clcmd("say /guns", "dai_gun")
	register_clcmd("say guns", "dai_gun")

	glavnoto = menu_create("[ReaL-TeaM]Menu", "posreshtane")
	menu_additem(glavnoto, "New Guns")
	menu_additem(glavnoto, "Previous Guns")
	menu_additem(glavnoto, "Previous + Save")

	osnovno = menu_create("Primary Weapons", "dai_wep")
	menu_additem(osnovno, "AK47"), 		menu_additem(osnovno, "M4A1")
	menu_additem(osnovno, "SG552"), 	menu_additem(osnovno, "AUG")
	menu_additem(osnovno, "Galil"),		menu_additem(osnovno, "Famas")
	menu_additem(osnovno, "Scout"),		menu_additem(osnovno, "AWP \r[$10000]")
	menu_additem(osnovno, "M249"),		menu_additem(osnovno, "M3")
	menu_additem(osnovno, "XM1014"),	menu_additem(osnovno, "MP5 Navy")
	menu_additem(osnovno, "UMP45"),		menu_additem(osnovno, "P90")
	menu_additem(osnovno, "TMP"),		menu_additem(osnovno, "Mac10")
	menu_additem(osnovno, "Go to previous menu")

	//Neka tuk sedqt vsi4ki ceni
	ceni[CSW_AWP] = 10000

	vtorichno = menu_create("Secondary", "pishtak")
	menu_additem(vtorichno, "\rDeagle")
	menu_additem(vtorichno, "USP")
	menu_additem(vtorichno, "Glock 18")
	menu_additem(vtorichno, "Five Seven")
	menu_additem(vtorichno, "p228")
	menu_additem(vtorichno, "Elite")
	menu_additem(vtorichno, "Go to previous menu")
}

public client_connect(id)
{
	give_weapon_onspawn[id] = false
}

public dai_gun(id)
{
	menu_display(id, glavnoto)
}

public ragdane(id)
{
	if(!is_user_alive(id)) return
	if(give_weapon_onspawn[id])
		Give_Weapons(id, true)
	else
		menu_display(id, glavnoto)
}
public posreshtane(id, menu, item)
{
	switch(item)
	{
		case 0:menu_display(id, vtorichno)
		case 1:Give_Weapons(id, false)
		case 2:Give_Weapons(id, true)
	}
}

Give_Weapons(id, bool:Save)
{
	if(!is_user_alive(id)) return
	new csw_prim = user_weps[id][Prim], csw_sec = user_weps[id][Sec]

	strip_user_weapons(id)
	give_item(id, "weapon_knife")
	give_item(id, "weapon_hegrenade")

	//if(csw_prim == 0) {menu_display(id, osnovno); 	return;}
	new cena = ceni[csw_prim], cena2 = ceni[csw_sec]
	if(cena > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4primary^3!")
		}else{
			give_user_wep(id, csw_prim)
			cs_set_user_money(id, money - cena, 1)
		}
	} else	give_user_wep(id, csw_prim)

	//if(csw_sec == 0)  {menu_display(id, vtorichno); 	return;}
	if(cena2 > 0)
	{
		new money = cs_get_user_money(id)
		if(money < cena2)
		{
			ColorChat(id, RED, "^4[^1Guns^4] ^3You dont have enough money for ^4secondary^3!")
		} else {
			give_user_wep(id, csw_sec)
			cs_set_user_money(id, money - cena2, 1)
		}
	} else 	give_user_wep(id, csw_sec)

	if(Save)give_weapon_onspawn[id] = true
	else	give_weapon_onspawn[id] = false
}

give_user_wep(id, csw)
{
	if(csw == 0) return
	new WeaponName[20]
	get_weaponname(csw, WeaponName, 19)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
	give_item(id, WeaponName)
}

public dai_wep(id, menu, item)
{
	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)

	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'a':switch(name[chara+1])
			{
				case 'k':user_weps[id][Prim] = CSW_AK47
				case 'u':user_weps[id][Prim] = CSW_AUG
				case 'w':user_weps[id][Prim] = CSW_AWP
			}
		case 'm':switch(name[chara+1])
			{
				case 'p':user_weps[id][Prim] = CSW_MP5NAVY
				case 'a':user_weps[id][Prim] = CSW_MAC10
				case '4':user_weps[id][Prim] = CSW_M4A1
				case '3':user_weps[id][Prim] = CSW_M3
				case '2':user_weps[id][Prim] = CSW_M249
			}
		case 's': {if(name[chara+1]== 'g')user_weps[id][Prim] = CSW_SG552 ;else user_weps[id][Prim] = CSW_SCOUT;}
		case 'g': {if(name[chara+1]== 'a')user_weps[id][Prim] = CSW_GALIL ;else {menu_display(id, vtorichno); return;}}
		case 'x':user_weps[id][Prim] = CSW_XM1014
		case 'u':user_weps[id][Prim] = CSW_UMP45
		case 't':user_weps[id][Prim] = CSW_TMP
		case 'f':user_weps[id][Prim] = CSW_FAMAS
		case 'p':user_weps[id][Prim] = CSW_P90
	}
	//menu_display(id, vtorichno)
	Give_Weapons(id, false)
}

public pishtak(id, menu, item)
{
	if(!is_user_connected(id))
	{
		return
	}

	new name[21], chara
	menu_item_getinfo(menu, item, name[0], name, 1, name, 20, menu)
	strtolower(name)

	if(name[0] == '\' ) chara = 2
	switch(name[chara])
	{
		case 'd':user_weps[id][Sec] = CSW_DEAGLE
		case 'u':user_weps[id][Sec] = CSW_USP
		case 'g':{if(name[chara+1]== 'l') user_weps[id][Sec] = CSW_GLOCK18 ;else {menu_display(id, glavnoto); return;}}
		case 'f':user_weps[id][Sec] = CSW_FIVESEVEN
		case 'p':user_weps[id][Sec] = CSW_P228
		case 'e':user_weps[id][Sec] = CSW_ELITE
	}
	menu_display(id, osnovno)
	//Give_Weapons(id, false)
}
Пак дава грешка.
L 05/09/2019 - 20:52:53: Start of error session.
L 05/09/2019 - 20:52:53: Info (map "de_aztec") (file "addons/amxmodx/logs/error_20190509.log")
L 05/09/2019 - 20:52:53: Player 9 is not in game.
L 05/09/2019 - 20:52:53: [AMXX] Displaying debug trace (plugin "weapons_menu.amxx", version "1.0")
L 05/09/2019 - 20:52:53: [AMXX] Run time error 10: native error (native "menu_display")
L 05/09/2019 - 20:52:53: [AMXX] [0] weapons_menu.sma::pishtak (line 190)
93.123.18.59:27016

Потребителски аватар

OciXCrom TM
Администратор
Администратор
Мнения: 5382
Регистриран: 06 окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 87 пъти
Получена благодарност: 600 пъти
Години: 21
Контакти:

Преработка на wepons_menu дава грешка в error.log

Мнение от OciXCrom TM » 10 май 2019, 01:04

При положение, че грешката отново я дава на ред 190, а аз в кода добавих няколко реда и въпросният ред вече е 195, не си компилирал/заменил плъгина в сървъра. Хайде малко по-сериозно...

Отговори

Върни се в “Заявки за плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 8 госта