House Problem[Delete All Pickups]
#1

Hello.I am an amateur scripter,and I have a problem.Yesterday,I setted the number of houses on my server to 100,and this was deleting all my pickups on the server.I have this loops at OnGameModeInit,and I don't know what is the problem.Please,help me.
pawn Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        if(HouseInfo[h][hOwned] == 0)
        {
            format(stringp, sizeof(stringp), "{FFFFFF}[{AAAAFF}House{FFFFFF}]\n[{AAAAFF}For Sale{FFFFFF}]");
            Create3DTextLabel(stringp,COLOR_GROVE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0, 1);
            CreateDynamicPickup(1239, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],-1,-1,-1,100.0);
            pickups++;
        }
        if(HouseInfo[h][hOwned] == 1)
        {
            format(stringp, sizeof(stringp), "{FFFFFF}[{AAAAFF}House{FFFFFF}]\n[{AAAAFF}Owned{FFFFFF}]");
            Create3DTextLabel(stringp,COLOR_GROVE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0, 1);
            AddStaticPickup(1239, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
            pickups++;
        }
    }
    for(new h = 0; h < sizeof(BizzInfo); h++)
    {
        if(BizzInfo[h][bOwned] == 0)
        {
            format(stringp, sizeof(stringp), "{FFFFFF}[{AAAAFF}Business{FFFFFF}]\n[{AAAAFF}For Sale{FFFFFF}]");
            Create3DTextLabel(stringp,COLOR_1BLUE,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.75, 25.0, 0, 1);
            AddStaticPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
            pickups++;
        }
        if(BizzInfo[h][bOwned] == 1)
        {
            format(stringp, sizeof(stringp), "{FFFFFF}[{AAAAFF}Business{FFFFFF}]\n[{AAAAFF}Owned{FFFFFF}]");
            Create3DTextLabel(stringp,COLOR_1BLUE,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.75, 25.0, 0, 1);
            AddStaticPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
            pickups++;
        }
    }
    for(new h = 0; h < sizeof(SBizzInfo); h++)
    {
        if(SBizzInfo[h][sbOwned] == 0)
        {
            format(stringp, sizeof(stringp), "{FFFFFF}[{AAAAFF}Business{FFFFFF}]\n[{AAAAFF}For Sale{FFFFFF}]");
            Create3DTextLabel(stringp,COLOR_1BLUE,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+0.75, 25.0, 0, 1);
            AddStaticPickup(1239, 2, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
            pickups++;
        }
        if(SBizzInfo[h][sbOwned] == 1)
        {
            format(stringp, sizeof(stringp), "{FFFFFF}[{AAAAFF}Business{FFFFFF}]\n[{AAAAFF}Owned{FFFFFF}]");
            Create3DTextLabel(stringp,COLOR_1BLUE,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+0.75, 25.0, 0, 1);
            AddStaticPickup(1239, 2, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
            pickups++;
        }
    }
P.S.:Somebody told me that I must use streamer to fix this problem,but I don't know how.
@Sorry for my bad english,i tried to write corectly.
Reply
#2

UP!!Please,help me...
Reply
#3

Streamer is an include which you must download and place it in your script. That sounds like the logical situation.
Reply
#4

yes you defenatly need to streem the 100 houses.
use a streamers for example Incognito's streamer.
and change the way the 3d text are created and the labels.

pawn Код:
CreateDynamic3DTextLabel
CreateDynamicPickup
But check the native first to see if you have everything in order.
Reply
#5

I have Incognito's streamer.Something like this?
pawn Код:
CreateDynamic3DTextLabel(stringp,COLOR_GROVE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0, 1);
            CreateDynamicPickup(1239, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], -1, -1, -1, 100.0);
Doesn't work.Any other idea?
Reply
#6

what do you mean by "does work" ? it gives you an error they don't get streamed ?
Reply
#7

My pickups doesn't appear
Reply
#8

Try replacing:
pawn Код:
AddStaticPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
With:
pawn Код:
AddStaticPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], -1);
Read Here: http://www.wiki.sa-mp.com/wiki/AddStaticPickup
Or: http://www.wiki.sa-mp.com/wiki/CreatePickup

If you read through the parameters uses, it tells you the virtual world parameter should be set to -1 to be visible at all times. So just add -1 to all AddStaticPickup or CreatePickup functions for them to become visible.
Reply
#9

Look,when I set this:
pawn Код:
new HouseInfo[100][hInfo];
to 100,all my pickups and all my objects disappear.

I tried with
pawn Код:
AddStaticPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], -1);
and with
pawn Код:
CreateDynamicPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], -1, -1, -1, 100.0);
because the native of my streamer is like this:
pawn Код:
CreateDynamicPickup(model, type, x, y, z, worldid, interiorid, playerid, streamedistance);
And all my pickups and all my objects disappear.Any other idea?
Reply
#10

have you debug d it ?
see if the loop even runs.
see if the created pickups are invalid or in different pos.
Debugging will only help you here my friend
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)