NoobAlert (variables) - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NoobAlert (variables) (
/showthread.php?tid=198222)
NoobAlert (variables) -
hanzen - 11.12.2010
Hello
Working on factions in a script, I want to retrieve some data from the MySQL table. Everything works except the varchars.
Код:
mysql_fetch_field("id", fdata); FactionInfo[fID] = strval(fdata);
mysql_fetch_field("cash", fdata); FactionInfo[fCash] = strval(fdata);
mysql_fetch_field("crack", fdata); FactionInfo[fCrack] = strval(fdata);
mysql_fetch_field("pot", fdata); FactionInfo[fPot] = strval(fdata);
mysql_fetch_field("mats", fdata); FactionInfo[fMats] = strval(fdata);
FactionInfo[fName] = mysql_fetch_field("name", fdata);
FactionInfo[fColor] = mysql_fetch_field("color", fdata);
FactionInfo[fLeader] = mysql_fetch_field("leader", fdata);
FactionInfo[fRank0] = mysql_fetch_field("rank0", fdata);
FactionInfo[fRank1] = mysql_fetch_field("rank1", fdata);
FactionInfo[fRank2] = mysql_fetch_field("rank2", fdata);
FactionInfo[fRank3] = mysql_fetch_field("rank3", fdata);
FactionInfo[fRank4] = mysql_fetch_field("rank4", fdata);
FactionInfo[fRank5] = mysql_fetch_field("rank5", fdata);
FactionInfo[fRank6] = mysql_fetch_field("rank6", fdata);
As I understood you don't need anything like strval() or floatstr() when getting plain text?
Would really appreciate answers!
Re: NoobAlert (variables) -
hanzen - 11.12.2010
I also tried this:
Код:
mysql_fetch_field("name", FactionInfo[fName]);
Re: NoobAlert (variables) -
hanzen - 11.12.2010
Код:
mysql_fetch_field("name", fdata); strmid(FactionInfo[fName], fdata, 0, strlen(fdata), 755);
Still no good