Problem with streamer
#1

i have a little issue with this:
pawn Код:
new query[256], savingstring[20], houseid;
    format(query, sizeof(query),"SELECT * FROM  `houses` ORDER BY `id`");
    mysql_query(query);
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_fetch_field_row(savingstring, "id"); houseid = strval(savingstring);
        mysql_fetch_field_row(savingstring, "iconx"); hInfo[houseid][iconx] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "icony"); hInfo[houseid][icony] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "iconz"); hInfo[houseid][iconz] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interiorX"); hInfo[houseid][InteriorX] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interiorY"); hInfo[houseid][InteriorY] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interiorZ"); hInfo[houseid][InteriorZ] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interior"); hInfo[houseid][Interior] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "price"); hInfo[houseid][Cost] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "sellprice"); hInfo[houseid][Sell] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "virtualworld"); hInfo[houseid][Virtualworld] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "locked"); hInfo[houseid][Locked] = strval(savingstring);
        mysql_fetch_field_row(hInfo[houseid][Name], "owner");
        if(strcmp(hInfo[houseid][Name],"ForSale",true)==0)
        {
            HousePickup[houseid] = CreatePickup(1273, 23, hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz]);//not bought
            HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 32, 0, hInfo[houseid][Virtualworld], hInfo[houseid][Interior], -1, 100.0);
        }
        else
        {
            HousePickup[houseid] = CreatePickup(1272, 23, hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz]);//bought
            HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 31, 0, hInfo[houseid][Virtualworld], hInfo[houseid][Interior], -1, 100.0);
        }
        printf("Loaded house %d Owner: %s", houseid, hInfo[houseid][Name]);
    }
    mysql_free_result();
It works all fine exept the CreateDynamicMapIcon. I dont know what is wrong but of some reason it wont load them.
Reply
#2

try this
pawn Код:
HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 31, 0, hInfo[houseid][Virtualworld], 0, -1, 100.0);
because you're getting the interior id of the store instead of 0 = default interior
Reply
#3

*** Streamer Plugin: Obsolete or invalid native "Streamer_CallbackHook" found (script needs to be recompiled with the latest include file)
Reply
#4

Quote:
Originally Posted by cordellpwnz
Посмотреть сообщение
*** Streamer Plugin: Obsolete or invalid native "Streamer_CallbackHook" found (script needs to be recompiled with the latest include file)
First of all make your own topic if you need help, besides that do what it says. download the new streamer and compile it with that.
Reply
#5

Quote:
Originally Posted by pds2012
Посмотреть сообщение
try this
pawn Код:
HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 31, 0, hInfo[houseid][Virtualworld], 0, -1, 100.0);
because you're getting the interior id of the store instead of 0 = default interior
hmmmm... didnt work
Reply
#6

just a question only this
pawn Код:
HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 31, 0, hInfo[houseid][Virtualworld], hInfo[houseid][Interior], -1, 100.0);
map icon doesn't work or this
pawn Код:
HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 32, 0, hInfo[houseid][Virtualworld], hInfo[houseid][Interior], -1, 100.0);
doesn't work too?

i just some did experiment. try this code if it works
pawn Код:
new query[256], savingstring[20], houseid;
    format(query, sizeof(query),"SELECT * FROM  `houses` ORDER BY `id`");
    mysql_query(query);
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_fetch_field_row(savingstring, "id"); houseid = strval(savingstring);
        mysql_fetch_field_row(savingstring, "iconx"); hInfo[houseid][iconx] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "icony"); hInfo[houseid][icony] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "iconz"); hInfo[houseid][iconz] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interiorX"); hInfo[houseid][InteriorX] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interiorY"); hInfo[houseid][InteriorY] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interiorZ"); hInfo[houseid][InteriorZ] = floatstr(savingstring);
        mysql_fetch_field_row(savingstring, "interior"); hInfo[houseid][Interior] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "price"); hInfo[houseid][Cost] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "sellprice"); hInfo[houseid][Sell] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "virtualworld"); hInfo[houseid][Virtualworld] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "locked"); hInfo[houseid][Locked] = strval(savingstring);
        mysql_fetch_field_row(hInfo[houseid][Name], "owner");
        if(strcmp(hInfo[houseid][Name],"ForSale",true)==0)
        {
            HousePickup[houseid] = CreatePickup(1273, 23, hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz]);//not bought
            HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 32, 0, 0, 0, -1, 150.0);
        }
        else
        {
            HousePickup[houseid] = CreatePickup(1272, 23, hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz]);//bought
            HouseIcon[houseid] = CreateDynamicMapIcon(hInfo[houseid][iconx], hInfo[houseid][icony], hInfo[houseid][iconz], 31, 0, 0, 0, -1, 150.0);
        }
        printf("Loaded house %d Owner: %s", houseid, hInfo[houseid][Name]);
    }
    mysql_free_result();
EDIT
are you sure that it save's the right X,Y,Z coordinations?
Reply
#7

It works now, the problem was te virtual world and the interior, thanks dude
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)