SA-MP Forums Archive
sqlite format error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sqlite format error (/showthread.php?tid=647889)



sqlite format error - MyUndiesSmell - 12.01.2018

I can't seem to figure it out.

Quote:
Код:
C:\Users\User\Dropbox\script\gamemodes\DM.pwn(1439) : error 012: invalid function call, not a valid address
C:\Users\User\Dropbox\script\gamemodes\DM.pwn(1439) : warning 215: expression has no effect
C:\Users\User\Dropbox\script\gamemodes\DM.pwn(1439) : error 001: expected token: ";", but found ")"
C:\Users\User\Dropbox\script\gamemodes\DM.pwn(1439) : error 029: invalid expression, assumed zero
C:\Users\User\Dropbox\script\gamemodes\DM.pwn(1439) : fatal error 107: too many error messages on one line
Quote:
Код:
format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '0', '%s', '%s', '%s', '%s')", DB_Escape(pName1), reason, DB_Escape(pName1(playerid)), datestring, timestring);



Re: sqlite format error - MyUndiesSmell - 12.01.2018

I think I found my problem but still not fixing the error.
Код:
stock pName(playerid)
{
	new GetName[24];
	GetPlayerName(playerid, GetName, 24);
	return GetName;
}



Re: sqlite format error - MyUndiesSmell - 12.01.2018

I no longer need help I fixed the problem.


Re: sqlite format error - JaKe Elite - 12.01.2018

You no longer need to use DB_Escape, You can the %q. (Replace the %s)


Re: sqlite format error - Wuhler - 12.01.2018

ERROR:

Код:
 format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '0', '%s', '%s', '%s', '%s')", DB_Escape(pName1), reason, DB_Escape(pName1(playerid)), datestring, timestring);
->

Код:
 format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '0', '%s', '%s', '%s', '%s')", DB_Escape(pName1(your_variable)), reason, DB_Escape(pName1(playerid)), datestring, timestring);