Cześć, potrzebuję waszej pomocy, robię plugin, boks mam problem z wysyłaniem zaproszenia do walki, główny problem jest z Player_id,
pomóżcie, chciałbym to jeszcze dziś zrobić, nie mam pomysłu jak błąd ten rozwiązać.
Problem: linjka 113, przy
case 0:{
if( Player_id[ id ] == 0 ){
box.sma(113) : error 017: undefined symbol "Player_id" box.sma(113) : warning 215: expression has no effect box.sma(113) : error 001: expected token: ";", but found "]" box.sma(113) : error 029: invalid expression, assumed zero box.sma(113) : fatal error 107: too many error messages on one line
#include <amxmisc> #include <amxmodx> #include <colorchat> #include <basebuilder> #include <cstrike> new Player_id_list[33][20] new player_id[33] new Player_id_ask[ 33 ] public plugin_init() { register_clcmd("say /box","Menu") register_clcmd("say /walka","Menu") } public Menu(id) { new MyMenu = menu_create("\rWalka \y(Box)\d:","show_menu_zaplaty"); menu_additem(MyMenu, "\yWybierz z kim chcesz sie bic."); menu_setprop(MyMenu, MPROP_EXIT, MEXIT_ALL); menu_setprop(MyMenu, MPROP_PERPAGE, 7); menu_display(id, MyMenu); } public show_menu_zaplaty(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return; } switch(item) { case 0: { if(get_user_team(id) != 1) { Menu(id); ColorChat(id, RED, "^x04***^x01 Nie mozesz uzyc tej opcji, poniewaz nie jestes zombie^x04 ***"); return; } new time = bb_get_build_time() if(!time) { ColorChat(id, RED, "^x04***^x01 Ustawic walke, mozesz tylko w czasie budowania^x04 ***"); return; } new Name[33] new gForm[128] new MyMenu = menu_create("Wybierz gracza:\d","wybierz_gracza"); for( new i = 1, d=0; i <= get_maxplayers(); i ++) { if(!is_user_connected(i)) continue; if( cs_get_user_team(i) == CS_TEAM_SPECTATOR || is_user_hltv(i) ) continue; if( i == id) continue; if(player_id[i] !=0) continue; Player_id_list[id][d++]=i get_user_name(i, Name, sizeof(Name)) format( gForm, sizeof( gForm ), "%s", Name) ColorChat(i, RED,"^x04***^x01 Wybrales Gracza:^x03 %s^x01, zeby sie z nim boksowac^x04 ***") menu_additem( MyMenu, gForm ) } menu_setprop(MyMenu, MPROP_EXITNAME, "Zamknij"); menu_setprop(MyMenu, MPROP_BACKNAME, "Poprzednia Strona"); menu_setprop(MyMenu, MPROP_NEXTNAME, "Nastepna Strona"); menu_setprop(MyMenu, MPROP_EXIT, MEXIT_ALL); menu_setprop(MyMenu, MPROP_PERPAGE, 7); menu_display(id, MyMenu); } } return; } public wybierz_gracza(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return; } if( !is_user_alive(id) ) SendAsk( id, Player_id_list[ id ][ item ] ) return; } public SendAsk( id_asker, id ){ Player_id_ask[ id ] = id_asker new gForm[ 128 ], Name[ 33 ] get_user_name( id_asker, Name, sizeof( Name ) ) format( gForm, sizeof( gForm ), "\rGracz:\y %s^n^n\w\rChce sie z toba boksowac.", Name ) new menu = menu_create( gForm, "SendAsk_2" ) menu_additem( menu, "Tak, chce z nim walczyc." ) menu_additem( menu, "Nie, nie mam ochoty." ) menu_display( id, menu, 0 ) } public SendAsk_2( id, menu, item ){ if( item == MENU_EXIT ){ menu_destroy( menu ) return PLUGIN_HANDLED } switch( item ){ case 0:{ if( Player_id[ id ] == 0 ){ new Name[ 33 ] get_user_name( id, Name, sizeof( Name ) ) Player_id[ id ] = Player_id_ask[ id ] Player_id[ Player_id_ask[ id ] ] = id ColorChat( Player_id_ask[ id ], TEAM_COLOR, "^x04***^x01 Gracz^x03 %s^x01 przyjal zaproszenie do walki^x04 ***", Name ) } } case 1:{ new Name[ 33 ] get_user_name( id, Name, sizeof( Name ) ) ColorChat( Player_id_ask[ id ], TEAM_COLOR, "^x04***^x01 Gracz^x03 %s^x01 nie przyjal walki^x04 ***", Name ) } } return PLUGIN_HANDLED; }
Użytkownik Pawlik4Ver edytował ten post 09.02.2017 14:25