Unable to load pickups from mysql - 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: Unable to load pickups from mysql (
/showthread.php?tid=443445)
Unable to load pickups from mysql -
thistooshallpass93 - 12.06.2013
Can somebody tell me what seems to be wrong with this query?
PHP код:
public LoadPickups(playerid)
{
new query[1000], savingstring[1000];
new Float:x,Float:y,Float:z;
format(query, sizeof(query), "SELECT * FROM Pickups");
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "PickupID"); PickupInfo[PickupID] = strval(savingstring);
mysql_fetch_field_row(savingstring, "ID"); PickupInfo[IDz] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Type"); PickupInfo[Type] = strval(savingstring);
mysql_fetch_field_row(savingstring, "X"); PickupInfo[X] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "Y"); PickupInfo[Y] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "Z"); PickupInfo[Z] = floatstr(savingstring);
mysql_free_result();
}
return 1;
}
Doesn't wanna load my floats.
EDIT: Nevermind, Fixed.
Re: Unable to load pickups from mysql -
Pottus - 12.06.2013
Why would you need this...
mysql_fetch_field_row(savingstring, "PickupID"); PickupInfo[PickupID] = strval(savingstring);
That will get set once you create your pickup.
Re: Unable to load pickups from mysql -
thistooshallpass93 - 12.06.2013
It's so that it is already loaded and so that i don't have to assign it some where else. It keeps it cleaner.
My mistake was my a loop. This loads perfectly fine.
PS: Next time instead of trying to raise your post count with ridiculous posts may you please actually help people out. If you don't have a response that will help someone just don't respond.
Please and thank you.