Mysql admin command problem +rep - 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: Mysql admin command problem +rep (
/showthread.php?tid=331654)
Mysql admin command problem +rep -
doreto - 05.04.2012
PROBLEM FIXED
Re: Mysql admin command problem +rep -
Bogdan1992 - 05.04.2012
Код:
format(Queryy,sizeof(Queryy),"SELECT `admin` FROM `playerdata` WHERE `username` LIKE '%s' LIMIT 1",PlayerName(playerid));
EDIT: By the way, change true with 1.
Re: Mysql admin command problem +rep -
doreto - 05.04.2012
Still allows me to use healall cmd
pawn Код:
stock player_admin(playerid)
{
new Queryy[100];
format(Queryy,sizeof(Queryy),"SELECT `admin` FROM `playerdata` WHERE `username`='%s' LIMIT 1",PlayerName(playerid));
mysql_query(Queryy);
mysql_free_result();
return 1;
}
Re: Mysql admin command problem +rep -
Bogdan1992 - 05.04.2012
You forgot to add the mysql_store_result(); Add it after mysql_query
Re: Mysql admin command problem +rep -
doreto - 05.04.2012
Quote:
Originally Posted by Bogdan1992
You forgot to add the mysql_store_result(); Add it after mysql_query
|
lol still allows me to use admin cmd
Re: Mysql admin command problem +rep -
Bogdan1992 - 05.04.2012
what do you have in that row? 1 and 0 right? if yes then
Код:
format(Queryy,sizeof(Queryy),"SELECT `admin` FROM `playerdata` WHERE `username` LIKE '%s' AND `admin` = 1 LIMIT 1",PlayerName(playerid));
Re: Mysql admin command problem +rep -
doreto - 05.04.2012
[QUOTE=Bogdan1992;1777953]what do you have in that row? 1 and 0 right? if yes then
if it is 0 it can use cmd but if is 1 it can
Re: Mysql admin command problem +rep -
doreto - 06.04.2012
PROBLEM FIXED
Re: Mysql admin command problem +rep - kikito - 06.04.2012
You're not taking the data from the mysql.
Re: Mysql admin command problem +rep -
doreto - 06.04.2012
Quote:
Originally Posted by (A)rray
You're not taking the data from the mysql.
|
what's the problem why i can't take date
EDIT: debug text
Quote:
[15:15:15] CMySQLHandler::Query(SELECT `admin` FROM `playerdata` WHERE `username` LIKE '[BG]PREDATOR' AND `admin` = 1 LIMIT 1) - Successfully executed.
[15:15:15] >> mysql_store_result( Connection handle: 1 )
[15:15:15] CMySQLHandler::StoreResult() - Result was stored.
[15:15:15] >> mysql_free_result( Connection handle: 1 )
[15:15:15] CMySQLHandler::FreeResult() - Result was successfully free'd.
|