What did I do wrong?
#1

Heres my load houses script.

pawn Code:
stock LoadHouses()
{
    mysql_query("SELECT * FROM houses WHERE hID > '0'");
    mysql_store_result();
   
    new row[128], Store[128];
    new nh = 1;
   
    while(mysql_fetch_row(row))
    {
        mysql_get_field("hID", Store); HouseInfo[nh][hID] = floatstr(Store);
        //EXT House Location
        mysql_get_field("hX", Store); HouseInfo[nh][hX] = floatstr(Store);
        mysql_get_field("hY", Store); HouseInfo[nh][hY] = floatstr(Store);
        mysql_get_field("hZ", Store); HouseInfo[nh][hZ] = floatstr(Store);
        //INT Exit Location
        mysql_get_field("hIntX", Store); HouseInfo[nh][hIntX] = floatstr(Store);
        mysql_get_field("hIntY", Store); HouseInfo[nh][hIntY] = floatstr(Store);
        mysql_get_field("hIntZ", Store); HouseInfo[nh][hIntZ] = floatstr(Store);
        //The Interior itself, and the virtual world its in(each house has its own VW
        mysql_get_field("hInt", Store); HouseInfo[nh][hInt] = floatstr(Store);
        HouseInfo[nh][hWorld] = nh;
        //Owner and misc house info
        mysql_get_field("hOwned", Store); HouseInfo[nh][hOwned] = floatstr(Store);
        mysql_get_field("hOwner", Store); HouseInfo[nh][hOwner] = floatstr(Store);
        mysql_get_field("hSlots", Store); HouseInfo[nh][hSlots] = floatstr(Store);
        mysql_get_field("hZone", Store); HouseInfo[nh][hZone] = floatstr(Store);
        mysql_get_field("hPrice", Store); HouseInfo[nh][hPrice] = floatstr(Store);
        mysql_get_field("hPark", Store); HouseInfo[nh][hPark] = floatstr(Store);
       
        if(HouseInfo[nh][hOwned] == 0)
            HouseInfo[nh][hPickup] = CreateDynamicPickup(1273,23,HouseInfo[nh][hX],HouseInfo[nh][hY],HouseInfo[nh][hZ],-1,-1,-1,200.0);
        else

            HouseInfo[nh][hPickup] = CreateDynamicPickup(1272,23,HouseInfo[nh][hX],HouseInfo[nh][hY],HouseInfo[nh][hZ],-1,-1,-1,200.0);
        printf("[MySQL]: House ID %d loaded", nh);
        nh++;
    }

    new str[128];
    format(str, sizeof(str), "[MySQL]: Number of houses loaded: %d", nh);
    print(str);
    mysql_free_result();
   
}
So, how would I fix these warnings?

Code:
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(193) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(203) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(206) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(207) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(208) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(209) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(210) : warning 213: tag mismatch
G:\Users\Austin\SAMP Related Stuff\SAMP\myGM\gamemodes\ovtcustom.pwn(211) : warning 213: tag mismatch
Reply
#2

You are using the functions on lines 193, 203, 206 - 211 incorrectly.

By the way, use sscanf to extract your data. It's much faster.
Reply
#3

How would I use sscanf to do that? Im pretty new at scripting. While im here, when I try to create these 3d text draws all that shows up is random numbers.

Another thing. How would I make these text draws have an outline (like yellow text/black outline) to make them contrast a bit better

pawn Code:
if(HouseInfo[nh][hOwned] == 0)
        {
            HouseInfo[nh][hIcon] = CreateDynamicMapIcon(HouseInfo[nh][hX],HouseInfo[nh][hY],HouseInfo[nh][hZ], 31, 0, 0, 0, -1, 400.0);
            HouseInfo[nh][hPickup] = CreateDynamicPickup(1273,23,HouseInfo[nh][hX],HouseInfo[nh][hY],HouseInfo[nh][hZ],-1,-1,-1,200.0);

            new msg[128];
            format (msg, sizeof(msg), "House for sale!\nAddress: %d %s\nPrice: %d\nSlots: %d", HouseInfo[nh][hID], HouseInfo[nh][hZone], HouseInfo[nh][hPrice], HouseInfo[nh][hSlots]);
            CreateDynamic3DTextLabel(msg, COLOR_YELLOW, HouseInfo[nh][hX], HouseInfo[nh][hY], HouseInfo[nh][hZ] + 1.0, 100.0);
        }
        else
        {
            HouseInfo[nh][hIcon] = CreateDynamicMapIcon(HouseInfo[nh][hX],HouseInfo[nh][hY],HouseInfo[nh][hZ], 32, 0, 0, 0, -1, 400.0);
            HouseInfo[nh][hPickup] = CreateDynamicPickup(1272,23,HouseInfo[nh][hX],HouseInfo[nh][hY],HouseInfo[nh][hZ],-1,-1,-1,200.0);
           
            new msg[128];
            format (msg, sizeof(msg), "House owned by: %s", HouseInfo[nh][hOwner]);
            CreateDynamic3DTextLabel(msg, COLOR_YELLOW, HouseInfo[nh][hX], HouseInfo[nh][hY], HouseInfo[nh][hZ] + 1.0, 100.0);
        }
Reply
#4

Well, I fixed the random numbers thing. It had to do with the fact that I was using floatstr() instead of strval().

Still wondering about the whole CreateDynamic3DTextLabel thing and the outlined text
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)