Text string (urgent :<)
#5

The error that you are getting refers to the strmid function. Here are the parameters for it:
pawn Код:
strmid(dest[],const source[],start,end,maxlength=sizeof dest)
You are getting the error because you have not defined your variable "desc" as an array. Try this:
pawn Код:
new tdata[255], Float:tx, Float:ty, Float:tz, desc[255];
format(query, sizeof(query), "SELECT * FROM `teleports` WHERE `para` = '%s';", tmp);
mysql_query(query); mysql_store_result();
       
mysql_fetch_field("x", tdata); tx = floatstr(tdata);
mysql_fetch_field("y", tdata); ty = floatstr(tdata);
mysql_fetch_field("z", tdata); tz = floatstr(tdata);
mysql_fetch_field("desc", tdata); strmid(desc, tdata, 0, strlen(tdata), 255);
Note that you may not need to use array sizes of 255; use a lower value if possible to improve on performance. Good luck!

EDIT:

For a VARCHAR field (ie your "desc" field) you can just store it direct like this:
pawn Код:
new tdata[255], Float:tx, Float:ty, Float:tz, desc[255];
format(query, sizeof(query), "SELECT * FROM `teleports` WHERE `para` = '%s';", tmp);
mysql_query(query); mysql_store_result();

mysql_fetch_field("x", tdata); tx = floatstr(tdata);
mysql_fetch_field("y", tdata); ty = floatstr(tdata);
mysql_fetch_field("z", tdata); tz = floatstr(tdata);
mysql_fetch_field("desc", desc);
Reply


Messages In This Thread
Text string (urgent :<) - by hanzen - 13.12.2010, 18:57
Re: Text string (urgent :<) - by Ash. - 13.12.2010, 18:58
Re: Text string (urgent :<) - by hanzen - 13.12.2010, 19:08
Re: Text string (urgent :<) - by hanzen - 13.12.2010, 19:23
Re: Text string (urgent :<) - by Benjo - 13.12.2010, 19:24
Re: Text string (urgent :<) - by hanzen - 13.12.2010, 21:23

Forum Jump:


Users browsing this thread: 3 Guest(s)