Help Needed !!
#1

new s[500];
if(AccountExists[playerid] && !PlayerLogged[playerid] && !IsPlayerNPC(playerid))
{
if(mysql_ping() == -1)
new pName[500];
new string[156];
GetPlayerName(playerid,pName,30);
CheckMySQL();
format(string, sizeof(string), "SELECT * FROM users WHERE Name = '%s'", pName);
mysql_query(string);
mysql_store_result();

Errors : : error 029: invalid expression, assumed zero
: error 001: expected token: ")", but found "new"
: error 003: declaration of a local variable must appear in a compound block
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
Reply
#2

Maybe try giving us the exact lines-which line has which number?
And tell us where this chunk of code is located,use your brain-nobody can read your mind or your script without seeing it.
Reply
#3

if(mysql_ping() == -1) = error 029: invalid expression, assumed zero


new pName[500]; = error 001: expected token: ")", but found "new"
: error 003: declaration of a local variable must appear in a compound block
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
Reply
#4

pawn Код:
if(mysql_ping() == -1)
You don't need '== -1'
It will check the connection just with:
pawn Код:
if(mysql_ping())
You can check more about that here.

About the second error,check the line before
pawn Код:
new pName[500];
You might've missed ')' as it says.
Reply
#5

if(mysql_ping()) is above
new pName[500];

But after doing this
if(mysql_ping())

it says invalid expression assumed zero
Reply
#6

You might add some brackets at
pawn Код:
if(mysql_ping())
Like:
pawn Код:
new s[500];
if(AccountExists[playerid] && !PlayerLogged[playerid] && !IsPlayerNPC(playerid))
{
 if(mysql_ping() == -1)
 {
  new pName[500];
  new string[156];
  GetPlayerName(playerid,pName,30);
  CheckMySQL();
  format(string, sizeof(string), "SELECT * FROM users WHERE Name = '%s'", pName);
  mysql_query(string);
  mysql_store_result();
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)