MySQL - OnPlayerDisconnect
#1

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new query[1000], Float:Spawn[4];
    GetPlayerPos(playerid, Spawn[0], Spawn[1], Spawn[2]);
    GetPlayerFacingAngle(playerid, Spawn[3]);

    mysql_format(MySQL_Handle, query, sizeof(query), "UPDATE `accounts` SET `Admin`=%d, `Money`=%d, `Skin`=%d, Age=%d, `Gender`=%d, `Kills`=%d, `Deaths`=%d, `Interior`=%d, `VirtualWorld`=%d, `Health`=%f, `Armour`=%f, `SpawnX`=%f, `SpawnY`=%f, `SpawnZ`=%f, `SpawnA`=%f WHERE `ID`=%d",\
    PlayerData[playerid][pAdmin], PlayerData[playerid][pMoney], PlayerData[playerid][pSkin], PlayerData[playerid][pAge], PlayerData[playerid][pGender], PlayerData[playerid][pKills],\  // Line 90
    PlayerData[playerid][pDeaths], PlayerData[playerid][pInterior], PlayerData[playerid][pVirtualWorld], PlayerData[playerid][pHealth], PlayerData[playerid][pArmour], Spawn[0], Spawn[1], Spawn[2], Spawn[3], PlayerData[playerid][pID]); // Line 91
    mysql_tquery(MySQL_Handle, query, "", ""); // Line 92
    return 1;
}
Getting these errors:

pawn Код:
Accounts.pwn(90) : error 075: input line too long (after substitutions)
Accounts.pwn(91) : error 017: undefined symbol "playe"
Accounts.pwn(92) : warning 217: loose indentation
Accounts.pwn(92) : error 017: undefined symbol "rid"
Accounts.pwn(92) : error 029: invalid expression, assumed zero
Accounts.pwn(92) : error 029: invalid expression, assumed zero
Accounts.pwn(92) : fatal error 107: too many error messages on one line
Reply
#2

Try splitting down the lines to make them shorter.
pawn Код:
PlayerData[playerid][pAdmin], PlayerData[playerid][pMoney], PlayerData[playerid][pSkin],
PlayerData[playerid][pAge], PlayerData[playerid][pGender], PlayerData[playerid][pKills],
PlayerData[playerid][pDeaths], PlayerData[playerid][pInterior], PlayerData[playerid][pVirtualWorld],
PlayerData[playerid][pHealth], PlayerData[playerid][pArmour], Spawn[0], Spawn[1], Spawn[2], Spawn[3],
PlayerData[playerid][pID]);
Reply
#3

Don't use '\' for commas/tokens, use this only for splitting strings to new line. You should better use strcat anyway for string.
Reply
#4

GetPlayer... functions do not work in OnPlayerDisconnect because the client (where the information has to come from) is already disconnected at that point.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)