←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

[ROZWIĄZANE] menu w pluginie

Locked

mlekowita's Photo mlekowita 31.10.2011

witam
piszę swój plugin ( menu ) i mam tam taką frazę :


case 1:{
show_motd(id,"legendars1.txt","Zestaw Tanszych Legend")


i to czyta plik legendars1.txt z folderu cstrike
a ja chce, żeby czytało z cstrike/addons/amxmodx/configs/legendars ale jak dodaję taką ścieżkę to nie chce się skomplikować ;/
więc piszę do was z pytaniem "Jak zrobić czytanie pliku z cstrike/addons/amxmodx/configs/legendars ?"

Nikt nie pomoże ?
Quote

  • +
  • -
sebul's Photo sebul 31.10.2011

show_motd(id, "addons/amxmodx/configs/legendars/legendars1.txt", "Zestaw Tanszych Legend");

Dajesz na pewno tak?
Quote

mlekowita's Photo mlekowita 01.11.2011

Jest dokładnie tak.
Błąd komplikacji


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

Ktoś chętny do pomocy ?

Proszę o pomoc.
Quote

  • +
  • -
Drzanas's Photo Drzanas 01.11.2011

Pokaż może całe sma.
Quote

mlekowita's Photo mlekowita 01.11.2011

Nie wiem po co ale macie. Wszystko się ładnie komplikuje gdy jest tak


case 1:{
show_motd(id,"legendars1.txt","Zestaw Tanszych Legend")


Dodaję tą ścieżkę i się nie da ;/



/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Legendars"
#define VERSION "1.0"
#define AUTHOR "Kacper"


public plugin_init() {
register_plugin(Legendars, 1.0, Kacper)
register_clcmd("say /legendars","funkcja")
register_clcmd("say legendars","funkcja")


}

public funkcja(id){
new menu = menu_create("Legendy","sterowanie")

menu_additem(menu,"Zestaw Tanszych Legend","1",ADMIN_USER,ADMIN_CHAT)
menu_additem(menu,"Zestaw Drozszych Legend","2",ADMIN_USER,ADMIN_CHAT)

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id,menu,0)
}

public sterowanie(id,menu,item){
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:{
show_motd(id,"legendars1.txt","Zestaw Tanszych Legend")
}
case 2:{
show_motd(id,"legendars2.txt","Zestaw Drozszych Legend")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
Quote

  • +
  • -
NewaX's Photo NewaX 01.11.2011

proszę zrobiles blad w
register_plugin(Legendars, 1.0, Kacper)
powinno byc
 register_plugin(PLUGIN, VERSION, AUTHOR)

poprawny kod z tym aby pliki bylo w config w folderze legendar
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Legendars"
#define VERSION "1.0"
#define AUTHOR "Kacper"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /legendars","funkcja")
	register_clcmd("say legendars","funkcja")

}
public funkcja(id){
	new menu = menu_create("Legendy","sterowanie")
	menu_additem(menu,"Zestaw Tanszych Legend","1",ADMIN_USER,ADMIN_CHAT)
	menu_additem(menu,"Zestaw Drozszych Legend","2",ADMIN_USER,ADMIN_CHAT)
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id,menu,0)
}
public sterowanie(id,menu,item){
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	new data[6], iName[64]
	new acces, callback
	menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
	new key = str_to_num(data)
	switch(key)
	{
		case 1:{
			show_motd(id,"addons/amxmodx/configs/legendars/legendars1.txt","Zestaw Tanszych Legend")
		}
		case 2:{
			show_motd(id,"addons/amxmodx/configs/legendars/legendars2.txt","Zestaw Drozszych Legend")
		}
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

Edited by newax, 01.11.2011 20:18.
Quote

mlekowita's Photo mlekowita 02.11.2011

Nic z tego. Nie komplikuje się :facepalm: Chyba, że może coś źle robię. ;> Mógłby ktoś sprawdzić ;)
Quote

  • +
  • -
NewaX's Photo NewaX 02.11.2011

Jak sie nie kompiluje

Attached Files

Quote

mlekowita's Photo mlekowita 03.11.2011

Pomogłeś łap plusiora ;)
Quote

  • +
  • -
Goliath's Photo Goliath 03.11.2011

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Posted Image raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
Quote
Locked