strval, but with strings - 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: strval, but with strings (
/showthread.php?tid=278622)
strval, but with strings -
Storm203 - 23.08.2011
pawn Code:
mysql_get_field("hInt", Store); HouseInfo[nh][hInt] = strval(Store);
mysql_get_field("hOwned", Store); HouseInfo[nh][hOwned] = strval(Store);
mysql_get_field("hOwner", Store); HouseInfo[nh][hOwner] = strval(Store);
mysql_get_field("hSlots", Store); HouseInfo[nh][hSlots] = strval(Store);
Okay, with this, strval works fine for hInt(interior id) hOwned (bool), hSlots (integer). However, hOwner is a string. So what would be the similar function to strval to use a string.
pawn Code:
mysql_get_field("hOwner", Store); HouseInfo[nh][hOwner] = Store;
Gives this error, so im stumped at this point
Code:
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(201) : error 047: array sizes do not match, or destination array is too small
Re: strval, but with strings -
mprofitt - 23.08.2011
try using strmid, sscanf or strcopy.
Re: strval, but with strings -
Storm203 - 23.08.2011
sscanf, didnt think of that. Let me give that a try
Re: strval, but with strings -
THE_KNOWN - 23.08.2011
format(HouseInfo[nh][hOwner],sizeof(HouseInfo[nh][hOwner]),"%s",Store);
________________________________________
Reputate if i have helped you
Re: strval, but with strings -
Storm203 - 23.08.2011
Already succeded with sscanf. Thanks anyway THE_KNOWN