[ROZWIĄZANE] Problem [argument type mismat...
Dr.PaLaCz
01.11.2011
Otóż mam problem.Mianowicie chcę,żeby komendy /sklep oraz /shop na sayu oraz team sayu,były tylko dla vipa.Przerobiłem plugin,ale przy komplikowaniu pojawia się problem
/tmp/text41l09K.sma(17) : error 035: argument type mismatch (argument 2)
/tmp/text41l09K.sma(18) : error 035: argument type mismatch (argument 2)
/tmp/text41l09K.sma(19) : error 035: argument type mismatch (argument 2)
/tmp/text41l09K.sma(20) : error 035: argument type mismatch (argument 2)
Plik sma wygląda tak:
[font="monospace"][color="#000000"]
/tmp/text41l09K.sma(17) : error 035: argument type mismatch (argument 2)
/tmp/text41l09K.sma(18) : error 035: argument type mismatch (argument 2)
/tmp/text41l09K.sma(19) : error 035: argument type mismatch (argument 2)
/tmp/text41l09K.sma(20) : error 035: argument type mismatch (argument 2)
Plik sma wygląda tak:
[font="monospace"][color="#000000"]
[/color][/font]/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <cstrike> #include <fun> #define PLUGIN "Pb Shop" #define VERSION "1.0" #define AUTHOR "[AvP] ELOS" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep",ADMIN_LEVEL_H,"Sklep"); register_clcmd("say_team /sklep",ADMIN_LEVEL_H,"Sklep"); register_clcmd("say /shop",ADMIN_LEVEL_H,"Sklep"); register_clcmd("say_team /shop",ADMIN_LEVEL_H,"Sklep"); } public Sklep(id) { new tytul[25]; format(tytul, 24, "Sklep Paintball VIP"); new menu = menu_create(tytul, "Sklep_Handler"); menu_additem(menu, "Granat Wybuchowy Koszt: 5000$");//1 menu_additem(menu, "Wyrzutnia Granatow Koszt: 14000$");//2 menu_additem(menu, "Granat Dymny Koszt: 4000$");//3 menu_additem(menu, "Super Marker Koszt: 6000$");//4 menu_display(id, menu); } public Sklep_Handler(id, menu, item) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE; new kasa = cs_get_user_money(id); if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } switch(item) { case 0: { if(kasa >= 5000) { cs_set_user_money(id, kasa-5000); give_item(id, "weapon_hegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Wybuchowy!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 1: { if(kasa >= 14000) { cs_set_user_money(id, kasa-14000); give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") client_print(id, print_chat, "[Sklep] Kupiles Wyrzutnie Granatow posiadasz 2 ladunki!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 2: { if(kasa >= 4000) { cs_set_user_money(id, kasa-4000); give_item(id, "weapon_smokegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Dymny!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 3: { if(kasa >= 6000) { cs_set_user_money(id, kasa-6000); give_item(id, "weapon_p90") give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); client_print(id, print_chat, "[Sklep] Kupiles Super Marker!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } } return PLUGIN_CONTINUE; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE * { rtf1 ansi deff0 { fonttbl { f0 fnil Tahoma; } } n viewkind4 uc1 pard lang1045 f0 fs16 n par } */
MarWit
01.11.2011
To jest na odwrót:
powinno być tak
register_clcmd("say /sklep",ADMIN_LEVEL_H,"Sklep");
register_clcmd("say_team /sklep",ADMIN_LEVEL_H,"Sklep");
register_clcmd("say /shop",ADMIN_LEVEL_H,"Sklep");
register_clcmd("say_team /shop",ADMIN_LEVEL_H,"Sklep");
powinno być tak
register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H);
register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H);
register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H);
register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H);
NiFreZ
01.11.2011
Dodatkowo żebyś zrozumiał
/tmp/text41l09K.sma(20) : error 035: argument type mismatch (argument 2)
XXXXXXXXXXXXXXXXXXXXXXXX ARGUMENT JEST ZŁY XX ARGUMENT 2 XX
register_clcmd("say /sklep",ADMIN_LEVEL_H,"Sklep");
xxxxxxxxxxxxxxxxxxxxx1 argumentxxx2 argument,xxxxxx3 argumentxxx
Dokształcajcie sie z elite !
Pozdro Tomi =]
/tmp/text41l09K.sma(20) : error 035: argument type mismatch (argument 2)
XXXXXXXXXXXXXXXXXXXXXXXX ARGUMENT JEST ZŁY XX ARGUMENT 2 XX
register_clcmd("say /sklep",ADMIN_LEVEL_H,"Sklep");
xxxxxxxxxxxxxxxxxxxxx1 argumentxxx2 argument,xxxxxx3 argumentxxx
Dokształcajcie sie z elite !
Pozdro Tomi =]
Dr.PaLaCz
01.11.2011
To jest na odwrót:
register_clcmd("say /sklep",ADMIN_LEVEL_H,"Sklep");
register_clcmd("say_team /sklep",ADMIN_LEVEL_H,"Sklep");
register_clcmd("say /shop",ADMIN_LEVEL_H,"Sklep");
register_clcmd("say_team /shop",ADMIN_LEVEL_H,"Sklep");
powinno być tak
register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H);
register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H);
register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H);
register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H);
Tak napisałem na początku,ale niestety nie działało,więc pomyślałem,że może kolejność jest zła,dlatego zamieniłem.Niestety,nawet gdy jest tak,nadal nie będąc vipem,mogę używać komendy /sklep i /shop na sayu i na team sayu.
MarWit
01.11.2011
zmień
public Sklep(id)na
public Sklep(id, level, cid)oraz na początku publicu daj
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
Dr.PaLaCz
01.11.2011
Problem z komplikacjązmień
public Sklep(id)napublic Sklep(id, level, cid)oraz na początku publicu daj
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
public Sklep(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED }A błędy to
/tmp/text1gYG9p.sma(25) : error 029: invalid expression, assumed zero
/tmp/text1gYG9p.sma(25) : error 017: undefined symbol "Sklep"
/tmp/text1gYG9p.sma(25) : error 017: undefined symbol "level"
/tmp/text1gYG9p.sma(25) : fatal error 107: too many error messages on one line
MarWit
01.11.2011
Podmień
public Sklep(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new tytul[25];
format(tytul, 24, "Sklep Paintball VIP");
new menu = menu_create(tytul, "Sklep_Handler");
menu_additem(menu, "Granat Wybuchowy Koszt: 5000$");//1
menu_additem(menu, "Wyrzutnia Granatow Koszt: 14000$");//2
menu_additem(menu, "Granat Dymny Koszt: 4000$");//3
menu_additem(menu, "Super Marker Koszt: 6000$");//4
menu_display(id, menu);
}
Dr.PaLaCz
01.11.2011
Cały czas błędy.
/tmp/textcywgc6.sma(25) : error 029: invalid expression, assumed zero
/tmp/textcywgc6.sma(25) : error 017: undefined symbol "Sklep"
/tmp/textcywgc6.sma(25) : error 017: undefined symbol "level"
/tmp/textcywgc6.sma(25) : fatal error 107: too many error messages on one line
Plik sma wygląda tak.
/tmp/textcywgc6.sma(25) : error 029: invalid expression, assumed zero
/tmp/textcywgc6.sma(25) : error 017: undefined symbol "Sklep"
/tmp/textcywgc6.sma(25) : error 017: undefined symbol "level"
/tmp/textcywgc6.sma(25) : fatal error 107: too many error messages on one line
Plik sma wygląda tak.
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <cstrike> #include <fun> #define PLUGIN "Pb Shop" #define VERSION "1.0" #define AUTHOR "[AvP] ELOS" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H); public Sklep(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new tytul[25]; format(tytul, 24, "Sklep Paintball VIP"); new menu = menu_create(tytul, "Sklep_Handler"); menu_additem(menu, "Granat Wybuchowy Koszt: 5000$");//1 menu_additem(menu, "Wyrzutnia Granatow Koszt: 14000$");//2 menu_additem(menu, "Granat Dymny Koszt: 4000$");//3 menu_additem(menu, "Super Marker Koszt: 6000$");//4 menu_display(id, menu); } public Sklep_Handler(id, menu, item) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE; new kasa = cs_get_user_money(id); if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } switch(item) { case 0: { if(kasa >= 5000) { cs_set_user_money(id, kasa-5000); give_item(id, "weapon_hegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Wybuchowy!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 1: { if(kasa >= 14000) { cs_set_user_money(id, kasa-14000); give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") client_print(id, print_chat, "[Sklep] Kupiles Wyrzutnie Granatow posiadasz 2 ladunki!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 2: { if(kasa >= 4000) { cs_set_user_money(id, kasa-4000); give_item(id, "weapon_smokegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Dymny!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 3: { if(kasa >= 6000) { cs_set_user_money(id, kasa-6000); give_item(id, "weapon_p90") give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); client_print(id, print_chat, "[Sklep] Kupiles Super Marker!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } } return PLUGIN_CONTINUE; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE * { rtf1 ansi deff0 { fonttbl { f0 fnil Tahoma; } } n viewkind4 uc1 pard lang1045 f0 fs16 n par } */
NiFreZ
02.11.2011
if(kasa >= 6000 && Tutaj wstaw Pobieranie flagi)
Else
Napisz : Nie masz kasy lub nie jestes vipem
Else
Napisz : Nie masz kasy lub nie jestes vipem
Dr.PaLaCz
02.11.2011
if(kasa >= 6000 && Tutaj wstaw Pobieranie flagi)
Else
Napisz : Nie masz kasy lub nie jestes vipem
Cały czas te błędy:
/tmp/textlbeIWj.sma(25) : error 029: invalid expression, assumed zero
/tmp/textlbeIWj.sma(25) : error 017: undefined symbol "Sklep"
/tmp/textlbeIWj.sma(25) : error 017: undefined symbol "level"
/tmp/textlbeIWj.sma(25) : fatal error 107: too many error messages on one line
Całość sma wygląda tak:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <cstrike> #include <fun> #define PLUGIN "Pb Shop" #define VERSION "1.0" #define AUTHOR "[AvP] ELOS" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H); public Sklep(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new tytul[25]; format(tytul, 24, "Sklep Paintball VIP"); new menu = menu_create(tytul, "Sklep_Handler"); menu_additem(menu, "Granat Wybuchowy Koszt: 5000$");//1 menu_additem(menu, "Wyrzutnia Granatow Koszt: 14000$");//2 menu_additem(menu, "Granat Dymny Koszt: 4000$");//3 menu_additem(menu, "Super Marker Koszt: 6000$");//4 menu_display(id, menu); } public Sklep_Handler(id, menu, item) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE; new kasa = cs_get_user_money(id); if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } switch(item) { case 0: { if(kasa >= 5000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-5000); give_item(id, "weapon_hegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Wybuchowy!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } case 1: { if(kasa >= 14000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-14000); give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") client_print(id, print_chat, "[Sklep] Kupiles Wyrzutnie Granatow posiadasz 2 ladunki!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } case 2: { if(kasa >= 4000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-4000); give_item(id, "weapon_smokegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Dymny!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } case 3: { if(kasa >= 6000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-6000); give_item(id, "weapon_p90") give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); client_print(id, print_chat, "[Sklep] Kupiles Super Marker!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } } return PLUGIN_CONTINUE; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE * { rtf1 ansi deff0 { fonttbl { f0 fnil Tahoma; } } n viewkind4 uc1 pard lang1045 f0 fs16 n par } */
NiFreZ
02.11.2011
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H);zamien na
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H); }
Dr.PaLaCz
02.11.2011
Dalej błędy,ale już lepiej.public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H);zamien napublic plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H); }
/tmp/textFGrDnH.sma(30) : error 017: undefined symbol "cmd_access"
/tmp/textFGrDnH.sma(42) : warning 209: function "Sklep" should return a value
1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textFGrDnH.amx (compile failed).
Całość sma wygląda tak:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <cstrike> #include <fun> #define PLUGIN "Pb Shop" #define VERSION "1.0" #define AUTHOR "[AvP] ELOS" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /sklep", "Sklep", ADMIN_LEVEL_H); register_clcmd("say /shop", "Sklep", ADMIN_LEVEL_H); register_clcmd("say_team /shop", "Sklep", ADMIN_LEVEL_H); } public Sklep(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new tytul[25]; format(tytul, 24, "Sklep Paintball VIP"); new menu = menu_create(tytul, "Sklep_Handler"); menu_additem(menu, "Granat Wybuchowy Koszt: 5000$");//1 menu_additem(menu, "Wyrzutnia Granatow Koszt: 14000$");//2 menu_additem(menu, "Granat Dymny Koszt: 4000$");//3 menu_additem(menu, "Super Marker Koszt: 6000$");//4 menu_display(id, menu); } public Sklep_Handler(id, menu, item) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE; new kasa = cs_get_user_money(id); if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } switch(item) { case 0: { if(kasa >= 5000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-5000); give_item(id, "weapon_hegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Wybuchowy!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } case 1: { if(kasa >= 14000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-14000); give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") client_print(id, print_chat, "[Sklep] Kupiles Wyrzutnie Granatow posiadasz 2 ladunki!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } case 2: { if(kasa >= 4000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-4000); give_item(id, "weapon_smokegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Dymny!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } case 3: { if(kasa >= 6000 && ADMIN_LEVEL_H) { cs_set_user_money(id, kasa-6000); give_item(id, "weapon_p90") give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); client_print(id, print_chat, "[Sklep] Kupiles Super Marker!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy,lub nie jestes Vipem!"); } } return PLUGIN_CONTINUE; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE * { rtf1 ansi deff0 { fonttbl { f0 fnil Tahoma; } } n viewkind4 uc1 pard lang1045 f0 fs16 n par } */
Dr.PaLaCz
02.11.2011
Pod
#include <amxmodx>daj#include <amxmisc>
Pomogło,problem rozwiązany,można zamknąć ;]
Dzięki za wszystko.
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, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL