SA-MP Forums Archive
Problem with streamer - 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)
+--- Thread: Problem with streamer (/showthread.php?tid=423111)



Problem with streamer - Frede - 16.03.2013

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.


Re: Problem with streamer - Patrick - 16.03.2013

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


Re: Problem with streamer - cordellpwnz - 16.03.2013

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


Re: Problem with streamer - kamzaf - 16.03.2013

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.


Re: Problem with streamer - Frede - 16.03.2013

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


Re: Problem with streamer - Patrick - 16.03.2013

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?


Re: Problem with streamer - Frede - 16.03.2013

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