SA-MP Forums Archive
Help MySQL 41-4 - 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: Help MySQL 41-4 (/showthread.php?tid=659138)



Help MySQL 41-4 - Nk-Rodrigo - 24.09.2018

my database not updated can help me?


if(strcmp(cmd,"/buy",true)==0)
{
if(IsPlayerConnected(playerid))
{
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, -1, " asdasda");
return 1;
}
if(strcmp(x_nr,"bizz",true) == 0)
{
if(Informacion[playerid][Negocio] != 100)
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR:{FFFFFF} u have a bizz.");
return 1;
}
for(new b = 0; b < sizeof(InfoNegocio); b++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, InfoNegocio[b][Entrada_X], InfoNegocio[b][Entrada_Y], InfoNegocio[b][Entrada_Z]) && InfoNegocio[b][Estado] == 0)
{
if(Informacion[playerid][Nivel] < InfoNegocio[b][Nivel])
{
format(string, sizeof(string), "ERROR:{FFFFFF} need lvl %d to buy",InfoNegocio[b][Nivel]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
if(GetPlayerCash(playerid) > InfoNegocio[b][Precio])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
Informacion[playerid][Negocio] = b;
InfoNegocio[b][Estado] = 1;
GivePlayerCash(playerid,-InfoNegocio[b][Precio]);
SendClientMessage(playerid,VERDE_FLUOR, "ยป{FFFFFF} u buy use /modbizz to config.");
mysql_query( Database, "SELECT * FROM `Bizz`" );
new query[150];
mysql_format(Database, query, sizeof(query), "UPDATE `Bizz` SET Estado='%d', Propietario='%d' WHERE ID=%i", InfoNegocio[b][Estado],sendername,Informacion[playerid][Negocio]);
mysql_tquery(Database, query, "", "");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR:{FFFFFF} Money.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR:{FFFFFF} Positions.");
return 1;
}
}
}
}
return 1;
}


Re: Help MySQL 41-4 - KinderClans - 24.09.2018

Funny how people are using latest mysql version but meanwhile they're still stuck with strcmp (CommandText).

Put your code between pawn tags, then post mysql log too.


Re: Help MySQL 41-4 - solstice_ - 24.09.2018

Post MySQL logs please


Re: Help MySQL 41-4 - Nk-Rodrigo - 24.09.2018

Solved but now only work on Bizz ID:0.