AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amxxpc.exe keep on compiling without compiling the output file(?) (https://forums.alliedmods.net/showthread.php?t=241977)

Rirre 06-12-2014 03:56

amxxpc.exe keep on compiling without compiling the output file(?)
 
When I compile this:
Code:
#define QUERY_UPDATE_SKILLS "INSERT INTO %s (uniqueid) VALUES ('%s') ON DUPLICATE KEY UPDATE authid ='%s',ip='%s',nick='%s',xp='%d',playerlevel='%d',skillpoints='%d',medals='%d',health='%d',armor='%d',rhealth='%d',rarmor='%d',rammo='%d',gravity='%d',speed='%d',dist='%d',dodge='%d SET `lastUpdated`=now()'" new c_Cache[1024]; formatex( g_Cache, 1023, QUERY_UPDATE_SKILLS, sql_table, nickname, authid, ip, nickname, xp[id], playerlevel[id], skillpoints[id], medals[id], health[id], armor[id], rhealth[id], rarmor[id], rammo[id], gravity[id], speed[id], dist[id], dodge[id], where_statement );
It just continue trying to compile the plugin without finishing it, while amxxpc.exe consuming from 12-13% of the processor constantly.

YamiKaitou 06-12-2014 04:23

Re: amxxpc.exe keep on compiling without compiling the output file(?)
 
I recall a previous discussion on the same thing and I think it had to do with the line being too long. Try breaking it up into multiple formatex calls

aron9forever 06-12-2014 06:06

Re: amxxpc.exe keep on compiling without compiling the output file(?)
 
it should spout out a "code unreachable" error, ya sure it doesn't?

Nextra 06-12-2014 07:30

Re: amxxpc.exe keep on compiling without compiling the output file(?)
 
Unreachable code errors result from constructs like this:

PHP Code:

somefunction() {
   return;

   new 
1;
   
// ...


This is probably a compiler limitation or bug, just as YamiKaitou suspects. Try splitting this statement up into multiple format(ex) statements.

aron9forever 06-12-2014 09:21

Re: amxxpc.exe keep on compiling without compiling the output file(?)
 
Quote:

Originally Posted by Nextra (Post 2150411)
Unreachable code errors result from constructs like this:

PHP Code:

somefunction() {
   return;

   new 
1;
   
// ...


This is probably a compiler limitation or bug, just as YamiKaitou suspects. Try splitting this statement up into multiple format(ex) statements.

I've recalled badly then, I was thinking about non terminated strings because of this

it's right, the line is too long, just add some newlines, it won't mess up the query

Rirre 06-12-2014 09:23

Re: amxxpc.exe keep on compiling without compiling the output file(?)
 
Quote:

Originally Posted by YamiKaitou (Post 2150276)
I recall a previous discussion on the same thing and I think it had to do with the line being too long. Try breaking it up into multiple formatex calls

Do not work either :/
Code:
        new pos;         pos += formatex( g_Cache[pos], charsmax(g_Cache)-pos-1, QUERY_UPDATE_SKILLS, sql_table, nickname, authid, ip, nickname, xp[id], playerlevel[id], skillpoints[id], medals[id], health[id], armor[id], rhealth[id], rarmor[id], rammo[id], gravity[id], speed[id], dist[id], dodge[id], where_statement );         pos += formatex( g_Cache[pos], charsmax(g_Cache)-pos-1, "SET `lastUpdated`=now()" );

My only option is to do this then?
Code:
    new g_Cache2[1024]; // update lastUpdated     formatex( g_Cache2, 1023, "UPDATE %s SET `lastUpdated`=now()", sql_table );

YamiKaitou 06-12-2014 19:15

Re: amxxpc.exe keep on compiling without compiling the output file(?)
 
Quote:

Originally Posted by Rirre (Post 2150465)
Do not work either :/
Code:
        new pos;         pos += formatex( g_Cache[pos], charsmax(g_Cache)-pos-1, QUERY_UPDATE_SKILLS, sql_table, nickname, authid, ip, nickname, xp[id], playerlevel[id], skillpoints[id], medals[id], health[id], armor[id], rhealth[id], rarmor[id], rammo[id], gravity[id], speed[id], dist[id], dodge[id], where_statement );         pos += formatex( g_Cache[pos], charsmax(g_Cache)-pos-1, "SET `lastUpdated`=now()" );

My only option is to do this then?
Code:
    new g_Cache2[1024]; // update lastUpdated     formatex( g_Cache2, 1023, "UPDATE %s SET `lastUpdated`=now()", sql_table );

Your line is still too long then. Break QUERY_UPDATE_SKILLS into 2 parts and try it again.


All times are GMT -4. The time now is 09:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.