CreatePickup doesn't return pickup ID
#1

How come under OnPlayerPickUpPickup "pickupid" is always 0? I tried picking two different pickups, one of them had to have an ID thats not 0.
Reply
#2

Bump
Reply
#3

The first pickup ID is always Zero (0) and it increments its value once more pickups are created. Try to create more business and their pickups , check their id's. I am sure they wont be the same.
Reply
#4

Okay...Thanks for that.

But i got another problem: how come under OnPlayerPickUpPickup "pickupid" is always 0? I tried picking two different pickups, one of them had to have an ID thats not 0.
Reply
#5

bump
Reply
#6

Did you have added counter++; in your code?
Reply
#7

Well i did, but that's not the problem anymore... It is in the message before "bump" ill update my first post
Reply
#8

Bump
Reply
#9

Show the code where you create the pickups
Reply
#10

pawn Код:
stock LoadBiznius()
{
    new query[170],counter,string[100],ticks = GetTickCount();
    mysql_query("SELECT * FROM verslai");
    mysql_store_result();
    while(mysql_fetch_row_format(query,"|"))
    {
        sscanf(query,"p<|>e<ds[24]s[51]fffdddd>",bInfo[counter]);
        bInfo[counter][BussinessPickup] = CreatePickup(1314,1,bInfo[counter][bpX],bInfo[counter][bpY],bInfo[counter][bpZ],0);
        printf("Pickupid while loading:%d",bInfo[counter][BussinessPickup]);
        if(bInfo[counter][Nupirktas] == 1) format(string,sizeof(string),"%s\nSavininkas: %s",bInfo[counter][bPavadinimas],bInfo[counter][Savininkas]);
        else format(string,sizeof(string),"Verslo pavadinimas: %s\nVerslas parduodamas\nVerslo kaina: %d$",bInfo[counter][bPavadinimas],bInfo[counter][Kaina]);
        bInfo[counter][Bussiness3D] = Create3DTextLabel(string,BIZ_COLOR,bInfo[counter][bpX],bInfo[counter][bpY],bInfo[counter][bpZ],10.0,0,1);
        counter++;
    }
    printf("[VERSLAI]Pakrauti %d verslai. Krovimo trukme:%d MS",mysql_num_rows(), GetTickCount() - ticks);
    mysql_free_result();
    return 1;
}
And the prints from above:
pawn Код:
[19:35:23] Pickupid while loading:0
[19:35:23] Pickupid while loading:1
[19:35:23] Pickupid while loading:2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)