PDA

View Full Version : Compiling Error


aoky
30/11/2016, 03:34 PM
(1337) : error 029: invalid expression, assumed zero
(1337) : error 017: undefined symbol "SCM"
(1337) : error 076: syntax error in the expression, or invalid function call
(1337) : fatal error 107: too many error messages on one line
(15)error 010: invalid function or declaration

Lines 1335 - 1342 :
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_YES))
{
ClearAnimations(playerid);
}
return 1;
}


Line 15 : (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))


Defines & Includes : #include <a_samp>
#include <sscanf2>
#include <YSI\y_ini>
#include <mSelection>
#include <CMD>
#include <foreach>
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
#define PRESSED(%0) \
#define SCM SendClientMessage
new skinlist = mS_INVALID_LISTID;
new vehlist = mS_INVALID_LISTID;
new Text:Time, Text:Date;
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define COLOR_BLUE 0xFFFFFFF
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xFF0000AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKBLUE 0x0000BBAA
#define DIALOGID 3
#define COLORS 14
#define RADIO 15
#define DIALOG_RULES 22
#define DIALOG_NEWS 33
#define DIALOG_TEAM 44
#define DIALOG_VIP 55
#define PREV_BG_COLOR2 0xFFFF00AA
#define DIALOG_BG_COLOR 0x4A5A6BBB
#define PREV_BG_COLOR 0x88888899

BrianFaria
30/11/2016, 03:43 PM
The error is in the define "#define PRESSED"
Delete the define "#define PRESSED (% 0) \" and add this "

#define PRESSED (% 0) (((newkeys & (% 0)) == (% 0)) && ((oldkeys & (% 0))! = (% 0)))

And delete the below this "(((newkeys & (% 0)) == (% 0)) && ((oldkeys & (% 0))! = (% 0)))"

aoky
30/11/2016, 03:46 PM
Fixed that, thanks. Although this error still exists.
Lines 1335 - 1342 :
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_YES))
{
ClearAnimations(playerid);
}
return 1;
}

aoky
30/11/2016, 03:48 PM
These are the errors I get now

(1337) : error 029: invalid expression, assumed zero
(1337) : error 029: invalid expression, assumed zero
(1337) : error 029: invalid expression, assumed zero
(1337) : fatal error 107: too many error messages on one line

SoFahim
30/11/2016, 03:49 PM
Put this on upper side or under the all defines or include.
#define SCM SendClientMessage

aoky
30/11/2016, 03:51 PM
Put this on upper side or under the all defines or include.
#define SCM SendClientMessage

Done that and I still have the errors

SoFahim
30/11/2016, 03:59 PM
if(PRESSED(newkeys & KEY_YES)

Replace your if(PRESSED(KEY_YES)) and place this

if(PRESSED(newkeys & KEY_YES)

BrianFaria
30/11/2016, 04:00 PM
Delete that line and note if the error persists, maybe you have the same thing defined elsewhere, there I do not see the error.

aoky
30/11/2016, 04:21 PM
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_YES))
{
ClearAnimations(playerid);
}
return 1;
}

I get this error now

SoFahim
30/11/2016, 05:44 PM
if(PRESSED(newkeys & KEY_YES)

Replace your if(PRESSED(KEY_YES)) and place this

if(PRESSED(newkeys & KEY_YES)

error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_YES))
{
ClearAnimations(playerid);
}
return 1;
}

I get this error now
Read what I said.

Stinged
30/11/2016, 06:25 PM
Change your definitions and includes to this:


#include <a_samp>
#include <sscanf2>
#include <YSI\y_ini>
#include <mSelection>
#include <CMD>
#include <foreach>
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
#define SCM SendClientMessage
new skinlist = mS_INVALID_LISTID;
new vehlist = mS_INVALID_LISTID;
new Text:Time, Textate;

#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define COLOR_BLUE 0xFFFFFFF
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xFF0000AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKBLUE 0x0000BBAA
#define DIALOGID 3
#define COLORS 14
#define RADIO 15
#define DIALOG_RULES 22
#define DIALOG_NEWS 33
#define DIALOG_TEAM 44
#define DIALOG_VIP 55
#define PREV_BG_COLOR2 0xFFFF00AA
#define DIALOG_BG_COLOR 0x4A5A6BBB
#define PREV_BG_COLOR 0x88888899



#define PRESSED (% 0) (((newkeys & (% 0)) == (% 0)) && ((oldkeys & (% 0))! = (% 0)))
The macro is ruined because of the spaces (Replaced by * to show you which ones I'm talking about)
#define PRESSED*(%*0) (((newkeys & (% 0)) == (% 0)) && ((oldkeys & (% 0))! = (% 0)))