strval, but with strings
#1

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
Reply
#2

try using strmid, sscanf or strcopy.
Reply
#3

sscanf, didnt think of that. Let me give that a try
Reply
#4

format(HouseInfo[nh][hOwner],sizeof(HouseInfo[nh][hOwner]),"%s",Store);

________________________________________

Reputate if i have helped you
Reply
#5

Already succeded with sscanf. Thanks anyway THE_KNOWN
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)