Database errors?
#1

Hello,
I am getting these errors while compiling
Код:
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : error 012: invalid function call, not a valid address
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : warning 215: expression has no effect
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : error 001: expected token: ";", but found ")"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : error 029: invalid expression, assumed zero
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Here is the code
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
        Query[ 200 ],
        name[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName(playerid, name, sizeof(name));
    if(Bit1_Get(g_PlayerLogged, playerid) == 1)//I am using rBits by RyDeR`
    {
        format(Query, sizeof(Query),"UPDATE `USERS` SET SCORE = '%d', KILLS = '%d', DEATHS = '%d', CASH = '%d', ADMINLEVEL = '%d', VIPLEVEL = '%d' WHERE `NAME` = '%s'", GetPlayerScore(playerid), Kills(playerid), Deaths(playerid), GetPlayerMoney(playerid), Bit16_Get(g_AdminLevel, playerid), Bit16_Get(g_VipLevel, playerid),DB_Escape(name));//Line 84(The one with errors)
        db_query(Database, Query);
        Bit1_Set(g_PlayerLogged, playerid, false);
    }
    return 1;
}
Any help would be appreciated
Please Help me here also if you can - https://sampforum.blast.hk/showthread.php?tid=377051
Reply
#2

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Hello,
I am getting these errors while compiling
Код:
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : error 012: invalid function call, not a valid address
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : warning 215: expression has no effect
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : error 001: expected token: ";", but found ")"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : error 029: invalid expression, assumed zero
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(84) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Here is the code
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
        Query[ 200 ],
        name[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName(playerid, name, sizeof(name));
    if(Bit1_Get(g_PlayerLogged, playerid) == 1)//I am using rBits by RyDeR`
    {
        format(Query, sizeof(Query),"UPDATE `USERS` SET SCORE = '%d', KILLS = '%d', DEATHS = '%d', CASH = '%d', ADMINLEVEL = '%d', VIPLEVEL = '%d' WHERE `NAME` = '%s'", GetPlayerScore(playerid), Kills(playerid), Deaths(playerid), GetPlayerMoney(playerid), Bit16_Get(g_AdminLevel, playerid), Bit16_Get(g_VipLevel, playerid),DB_Escape(name));//Line 84(The one with errors)
        db_query(Database, Query);
        Bit1_Set(g_PlayerLogged, playerid, false);
    }
    return 1;
}
Any help would be appreciated
Please Help me here also if you can - https://sampforum.blast.hk/showthread.php?tid=377051
You putted ";" in wrong line, erase it and put it like this:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
                 Query[ 200 ]      
                 name[ MAX_PLAYER_NAME ];
    GetPlayerName(playerid, name, sizeof(name));
    if(Bit1_Get(g_PlayerLogged, playerid) == 1)//I am using rBits by RyDeR`
    {
        format(Query, sizeof(Query),"UPDATE `USERS` SET SCORE = '%d', KILLS = '%d', DEATHS = '%d', CASH = '%d', ADMINLEVEL = '%d', VIPLEVEL = '%d' WHERE `NAME` = '%s'", GetPlayerScore(playerid), Kills(playerid), Deaths(playerid), GetPlayerMoney(playerid), Bit16_Get(g_AdminLevel, playerid), Bit16_Get(g_VipLevel, playerid),DB_Escape(name));//Line 84(The one with errors)
        db_query(Database, Query);
        Bit1_Set(g_PlayerLogged, playerid, false);
    }
    return 1;
}
Reply
#3

Please don't comment if you don't know..It works like that also...And btw it is not the line which is getting errors.
Reply
#4

Can you point out which line is 84?

Edit: Just saw it. Hold on.

Try changing:

pawn Код:
db_query(Database, Query);
to

pawn Код:
db_query(Query);
Reply
#5

It doesn't work.
And btw the problem is with the line above it. Not that line.
Reply
#6

Surrounding code sometimes affects the line the compilers says in producing an error.
Reply
#7

One of the functions that you use after the string is wrong. Check which one you are calling wrongly as we can't smell that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)