09.06.2012, 16:07
having problems with this at the moment, im guessing it is because of the double mysql query's
It spits this up
Код:
stock LoadStats(playerid) { new pName[24],Query[80],GetLoc[80]; GetPlayerName(playerid,pName,24); format(Query,sizeof(Query), "SELECT * FROM `Users` WHERE `Username` = '%s';", pName); mysql_query(Query); mysql_store_result(); mysql_fetch_row_format(Query, "|"); sscanf(Query, "e<p<|>s[24]s[23]i>", PInfo[playerid]); mysql_free_result(); format(GetLoc,sizeof(GetLoc), "SELECT `PosX`, `PosY`, `PosZ` FROM `Users` WHERE `Username` = '%s';", pName); mysql_query{GetLoc); mysql_store_result(); mysql_fetch_row_format(GetLoc, "|"); sscanf(Query2, "p<|>fff", UserStats[playerid][PosX], UserStats[playerid][PosY], UserStats[playerid][PosZ]); mysql_free_result(); GivePlayerMoney(playerid,PInfo[playerid][Money]); SetSpawnInfo(playerid, 0, 230, UserStats[playerid][PosX], UserStats[playerid][PosY], UserStats[playerid][PosZ], 10, 0,0,0,0,0,0); SpawnPlayer(playerid); return 1; }
Код:
C:\Users\Simon\Desktop\samp\gamemodes\bare.pwn(210) : error 028: invalid subscript (not an array or too many subscripts): "mysql_query" C:\Users\Simon\Desktop\samp\gamemodes\bare.pwn(210) : warning 215: expression has no effect C:\Users\Simon\Desktop\samp\gamemodes\bare.pwn(210) : error 001: expected token: ";", but found ")" C:\Users\Simon\Desktop\samp\gamemodes\bare.pwn(210) : error 029: invalid expression, assumed zero C:\Users\Simon\Desktop\samp\gamemodes\bare.pwn(210) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.