Help MySQL 41-4
#1

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;
}
Reply
#2

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.
Reply
#3

Post MySQL logs please
Reply
#4

Solved but now only work on Bizz ID:0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)