public SavePlayer(playerid)
{
new IP[20];
GetPlayerIp(playerid, IP, 20);
new Query[500];
new QueryFinal[1500] = "UPDATE `playerdata` SET ";
format(Query, sizeof(Query), "`username`='%s',`Deaths`='%d',`ArmstreaksInHand`='%d', `TimePlayer`='%d', `Rank`='%d', `Achievements`='%d', `HeadShots`='%d', `LongShots`='%d', `IP`='%s', `Kills`='%d',`Cash`='%d', `ArmstreakRecieved`='%d',`PlayerXP`='%d',`PlayerRankNumber`='%d' WHERE `Username`='%s'", ReturnPlayerName(playerid),PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pArmstreak],PlayerInfo[playerid][pTimePlayer],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pAchievements],PlayerInfo[playerid][pHeadShots], PlayerInfo[playerid][pLongShots], IP, PlayerInfo[playerid][pKills],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pArmstreakRecieved],PlayerInfo[playerid][pXP],PlayerInfo[playerid][pRankNumber],ReturnPlayerName(playerid));
strcat(QueryFinal, Query);
mysql_tquery(conn, QueryFinal, false, "OnQuerySend", "");
return 1;
}
format(Query, sizeof(Query), "`username`='%s',`Deaths`='%d',`ArmstreaksInHand`='%d', `TimePlayer`='%d', `Rank`='%d', `Achievements`='%d', `HeadShots`='%d', `LongShots`='%d', `IP`='%s', `Kills`='%d',`Cash`='%d', `ArmstreakRecieved`='%d',`PlayerXP`='%d',`PlayerRankNumber`='%d' WHERE `Username`='%s'", ReturnPlayerName(playerid),PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pArmstreak],PlayerInfo[playerid][pTimePlayer],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pAchievements],PlayerInfo[playerid][pHeadShots], PlayerInfo[playerid][pLongShots], IP, PlayerInfo[playerid][pKills],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pArmstreakRecieved],PlayerInfo[playerid][pXP],PlayerInfo[playerid][pRankNumber],ReturnPlayerName(playerid));
DDM.pwn(362) : error 017: undefined symbol "cache_get_data"
DDM.pwn(361) : warning 203: symbol is never used: "field"
DDM.pwn(378) : error 017: undefined symbol "cache_get_data"
DDM.pwn(377) : warning 203: symbol is never used: "field"
DDM.pwn(388) : error 017: undefined symbol "mysql_tquery"
DDM.pwn(397) : error 075: input line too long (after substitutions)
DDM.pwn(398) : error 017: undefined symbol "playeri"
DDM.pwn(399) : error 017: undefined symbol "d"
DDM.pwn(399) : error 029: invalid expression, assumed zero
DDM.pwn(399) : error 029: invalid expression, assumed zero
DDM.pwn(399) : fatal error 107: too many error messages on one line
Idk if it solves the problem, but I think you need to change "mysql_tquery" to "mysql_query"
|
mysql_tquery(conn, QueryFinal);
native mysql_tquery(connectionHandle, query[], callback[] = "", format[] = "", {Float,_}:...);
public CheckAccount(playerid, account[])
{
new rows, field;
cache_get_data(rows, field);
if(rows>=1)
{
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Welcome back","Welcome back to Contract Wars!\n\nType in your password below to login","Login","Leave");
accountExists[playerid] = true;
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "New account","Please input your password below to register a account","Register","Leave");
accountExists[playerid] = false;
}
return 1;
}
public CheckAccountEx(account[])
{
new rows, field;
cache_get_data(rows, field);
if(rows >= 1) { QueryState = true; }
else { QueryState = false; }
return QueryState;
}
I asked another person to script it but he told me to ask in forums about to prob. will try what u say.
What is the one causing Problems? EDIT: pawn Код:
line 359-382 Edit: If i use cache_get_row_count(), it says error 017: undefined symbol "cache_get_row_count" |
if(rows >= 1) // Nah, no need to do like this.
if(rows) // There are rows found!
if(!rows) // No rows found!
// OR
if(rows)
{
// Found rows
}
else
{
// No rows found
}
// If you really want to use the cache_get_data, just simply.
new rows, field;
cache_get_data(rows, field);
#undef fields
// OR if you're getting fields so
#undef rows
// Little bit simplifying your CheckAccountEx function
public CheckAccountEx(account[])
{
new rows, field;
cache_get_data(rows, field);
#undef field
if(rows)
QueryState = true;
else
QueryState = false;
return (QueryState ? true : false); // IDK, maybe just return QueryState. (Not needed this I guess)
}
public CheckAccount(playerid, account[])
{
new rows, field;
cache_get_data(rows, field); // 362
#undef field // 363
if(rows) // 364
{
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Welcome back","Welcome back to Contract Wars!\n\nType in your password below to login","Login","Leave");
accountExists[playerid] = true;
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "New account","Please input your password below to register a account","Register","Leave");
accountExists[playerid] = false;
}
return 1;
}
public CheckAccountEx(account[])
{
new rows, field;
cache_get_data(rows, field);
#undef field
if(rows)
QueryState = true;
else
QueryState = false;
return QueryState;
}
DDM.pwn(362) : error 017: undefined symbol "cache_get_data"
DDM.pwn(363) : error 017: undefined symbol "field"
DDM.pwn(363) : error 029: invalid expression, assumed zero
DDM.pwn(363 -- 364) : warning 215: expression has no effect
DDM.pwn(364) : error 001: expected token: ";", but found "if"
DDM.pwn(364) : fatal error 107: too many error messages on one lin
CheckAccountExist(playerid, account[])
{
if(IsPlayerNPC(playerid)) return 0;
new Query[90];
format(Query, sizeof(Query), "SELECT * FROM `playerdata` WHERE Username='%s'", account);
mysql_tquery(conn, Query, true, "CheckAccount", "is", playerid, account);
return 1;
}
public OnPlayerConnect(playerid)
{
// other things
CheckAccountExist(playerid, ReturnPlayerName(playerid));
// other things
}
ReturnPlayerName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}