SA-MP Forums Archive
Need help with this error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with this error (/showthread.php?tid=638750)



Need help with this error - baki - 05.08.2017

I get this error

PHP код:
C:\Users\Baki\Desktop\developer\pawno\include\sscanf2.inc(42) : error 001expected token";"but found "native" 
Here is the script where the error occurs

PHP код:
enum    _:e_lockmodes
{
    
LOCK_MODE_NOLOCK,
    
LOCK_MODE_PASSWORD,
    
LOCK_MODE_KEYS,
    
LOCK_MODE_OWNER
}
enum    _:e_selectmodes
{
    
SELECT_MODE_NONE,
    
SELECT_MODE_EDIT,
    
SELECT_MODE_SELL

would rep you if you helped me


Re: Need help with this error - RedGun2015 - 05.08.2017

Код HTML:
enum    _:e_lockmodes 
{ 
    LOCK_MODE_NOLOCK, 
    LOCK_MODE_PASSWORD, 
    LOCK_MODE_KEYS, 
    LOCK_MODE_OWNER 
}; 

enum    _:e_selectmodes 
{ 
    SELECT_MODE_NONE, 
    SELECT_MODE_EDIT, 
    SELECT_MODE_SELL 
};



Re: Need help with this error - baki - 05.08.2017

Still same error eh...
here is all

PHP код:
enum    _:e_lockmodes
{
    
LOCK_MODE_NOLOCK,
    
LOCK_MODE_PASSWORD,
    
LOCK_MODE_KEYS,
    
LOCK_MODE_OWNER
};
enum    _:e_selectmodes
{
    
SELECT_MODE_NONE,
    
SELECT_MODE_EDIT,
    
SELECT_MODE_SELL
};
enum    _:e_dialogids
{
    
DIALOG_BUY_HOUSE 7500,
    
DIALOG_HOUSE_PASSWORD,
    
DIALOG_HOUSE_MENU,
    
DIALOG_HOUSE_NAME,
    
DIALOG_HOUSE_NEW_PASSWORD,
    
DIALOG_HOUSE_LOCK,
    
DIALOG_SAFE_MENU,
    
DIALOG_SAFE_TAKE,
    
DIALOG_SAFE_PUT,
    
DIALOG_GUNS_MENU,
    
DIALOG_GUNS_TAKE,
    
DIALOG_FURNITURE_MENU,
    
DIALOG_FURNITURE_BUY,
    
DIALOG_FURNITURE_SELL,
    
DIALOG_VISITORS_MENU,
    
DIALOG_VISITORS,
    
DIALOG_KEYS_MENU,
    
DIALOG_KEYS,
    
DIALOG_SAFE_HISTORY,
    
DIALOG_MY_KEYS,
    
DIALOG_BUY_HOUSE_FROM_OWNER,
    
DIALOG_SELL_HOUSE,
    
DIALOG_SELLING_PRICE
};
enum    e_house
{
    
Name[MAX_HOUSE_NAME],
    
Owner[MAX_PLAYER_NAME],
    
Password[MAX_HOUSE_PASSWORD],
    
Address[MAX_HOUSE_ADDRESS],
    
FloathouseX,
    
FloathouseY,
    
FloathouseZ,
    
Price,
    
SalePrice,
    
Interior,
    
LockMode,
    
SafeMoney,
    
LastEntered,
    
Text3DHouseLabel,
    
HousePickup,
    
HouseIcon,
    
boolSave
};
enum    e_interior
{
    
IntName[MAX_INT_NAME],
    
FloatintX,
    
FloatintY,
    
FloatintZ,
    
intID,
    
Text3DintLabel,
    
intPickup
};
enum    e_furnituredata
{
    
ModelID,
    
Name[32],
    
Price
};
enum    e_furniture
{
    
SQLID,
    
HouseID,
    
ArrayID,
    
FloatfurnitureX,
    
FloatfurnitureY,
    
FloatfurnitureZ,
    
FloatfurnitureRX,
    
FloatfurnitureRY,
    
FloatfurnitureRZ
};
enum    e_sazone
{
    
SAZONE_NAME[28],
    
FloatSAZONE_AREA[6]
}; 



Re: Need help with this error - FailerZ - 05.08.2017

If you remove that _: behind the enumerator name will it compile fine?


Re: Need help with this error - baki - 05.08.2017

I did that but it brings a lot of errors


Re: Need help with this error - ISmokezU - 05.08.2017

Yeah because that's not the problem lol

it's coming from your sscanf2 Include

PHP код:
C:\Users\Baki\Desktop\developer\pawno\include\sscanf2.inc(42) : error 001expected token";"but found "native" 
Send us Line 40 - 45


Re: Need help with this error - FailerZ - 05.08.2017

Well then I guess you have to fix them. I have never seen any script declaring enumerators that way. This operator _: or idk what it is called is to get the enumerator elements number (useful in loops)

EDIT: I just saw above reply. I could be wrong but I was just trying to help. Sorry


Re: Need help with this error - Misiur - 05.08.2017

_: clears the enum tag, so you dont' have to use _: every time you loop through it later.


Re: Need help with this error - FailerZ - 05.08.2017

Quote:
Originally Posted by Misiur
Посмотреть сообщение
_: clears the enum tag, so you dont' have to use _: every time you loop through it later.
Interesting thanks for correcting me


Re: Need help with this error - baki - 05.08.2017

PHP код:
native sscanf(const data[], const format[], {Float,_}:...);
native unformat(const data[], const format[], {Float,_}:...) = sscanf;
native SSCANF_Init(playersinvalidlen);
native SSCANF_Join(playerid, const name[], npc);
native SSCANF_Leave(playerid);
native SSCANF_Option(const name[], value); 
This is from my sscanf2