14.07.2015, 16:04
Get these errors when compile the gamemode.
Код:
SIF\Button.pwn(774) : error 001: expected token: ";", but found "-identifier-" SIF\Button.pwn(780) : error 010: invalid function or declaration SIF\Button.pwn(784) : error 021: symbol already defined: "Iterator@" SIF\Button.pwn(809) : error 017: undefined symbol "Iterator@btn_CurrentlyNearIndex" SIF\Button.pwn(809) : warning 215: expression has no effect SIF\Button.pwn(809) : error 001: expected token: ";", but found "]" SIF\Button.pwn(809) : error 029: invalid expression, assumed zero SIF\Button.pwn(809) : fatal error 107: too many error messages on one line
Код:
#define INVALID_BUTTON_ID (-1) enum E_BTN_DATA { btn_area, Text3D: btn_label, Float: btn_posX, Float: btn_posY, Float: btn_posZ, Float: btn_size, btn_world, btn_interior, btn_link, btn_text[BTN_MAX_TEXT], btn_exData } enum e_button_range_data { btn_buttonId, Float: btn_distance } new btn_Data[BTN_MAX][E_BTN_DATA], Iterator: btn_Index<BTN_MAX> #if defined DEBUG_LABELS_BUTTON , btn_DebugLabelType, btn_DebugLabelID[BTN_MAX] #endif (780) ; static btn_CurrentlyNear[MAX_PLAYERS][BTN_MAX_INRANGE], (784)Iterator: btn_CurrentlyNearIndex[MAX_PLAYERS]<BTN_MAX_INRANGE>, btn_CurrentlyPressing[MAX_PLAYERS]; forward OnButtonPress(playerid, buttonid); forward OnButtonRelease(playerid, buttonid); forward OnPlayerEnterButtonArea(playerid, buttonid); forward OnPlayerLeaveButtonArea(playerid, buttonid); static BUTTON_DEBUG = -1;
Код:
hook OnScriptInit() { BUTTON_DEBUG = sif_debug_register_handler("SIF/Button"); sif_d:SIF_DEBUG_LEVEL_CALLBACKS:BUTTON_DEBUG("[OnScriptInit]"); (809) Iter_Init(btn_CurrentlyNearIndex); for(new i; i < MAX_PLAYERS; i++) { btn_CurrentlyPressing[i] = INVALID_BUTTON_ID; } #if defined DEBUG_LABELS_BUTTON btn_DebugLabelType = DefineDebugLabelType("BUTTON", 0xFF0000FF); #endif } hook OnPlayerConnect(playerid) { sif_dp:SIF_DEBUG_LEVEL_CALLBACKS:BUTTON_DEBUG("[OnPlayerConnect]")<playerid>; Iter_Clear(btn_CurrentlyNearIndex[playerid]); btn_CurrentlyPressing[playerid] = INVALID_BUTTON_ID; }