17.03.2013, 11:30
Hi
I have. the problem when a user buys a car and then relogt me smears from the server but if I go in the car and put in mysql tablle store to 0 it will work again.
I have. the problem when a user buys a car and then relogt me smears from the server but if I go in the car and put in mysql tablle store to 0 it will work again.
PHP код:
stock getPlayerAutos(playerid)
{
new pAutos[128];
new minpAuto;
new maxpAuto;
format(query,sizeof(query),"SELECT id FROM autos WHERE besitzer='%s' AND laden='1' ORDER by id ASC",SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()>0)
{
mysql_fetch_field("id",data);
minpAuto=strval(data);
}
else
{
minpAuto=0;
}
mysql_free_result();
format(query,sizeof(query),"SELECT id FROM autos WHERE besitzer='%s' AND laden='1' ORDER by id DESC",SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()>0)
{
mysql_fetch_field("id",data);
maxpAuto=strval(data);
}
else
{
maxpAuto=0;
}
mysql_free_result();
for(new i=minpAuto; i<=maxpAuto; i++)
{
format(query,sizeof(query),"SELECT id FROM autos WHERE laden='1' AND id='%i' AND besitzer='%s'",i,SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()==1)
{
if(i!=maxpAuto)
{
format(pAutos,sizeof(pAutos),"%s%i,",pAutos,i);
}
else
{
format(pAutos,sizeof(pAutos),"%s%i",pAutos,i);
}
}
mysql_free_result();
}
return pAutos;
}
//Problem gefunden by Enrico
stock loadPlayerAutos(playerid)
{
format(query,sizeof(query),"SELECT * FROM autos WHERE besitzer='%s' AND laden='1'",SpielerName(playerid));
mysql_query(query,1234,playerid,mysql_car);
return 1;
}