Why isnt this working? ?
#1

okay im trying to make a business script but i cant get this pickup to display the string when i pick it up!

pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
    for(new C; C<BusinessCount+1; C++)
    {
        if(pickupid == 1272)
        {
            new str[150];
            new Pname[24];
            if(BusinessInfo[C][BusOwner] == -1) format(str, sizeof(str), "%s ~n~~r~Cost price: $%d ~b~Sale price: $%d ~n~ ~g~Earn ammount: $%d", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn]); //Makes the string for a business with no owner.
            if(BusinessInfo[C][BusOwner] != -1)
            {
                GetPlayerName(BusinessInfo[C][BusOwner], Pname, 24);
                format(str, sizeof(str), "%s ~n~~r~Cost price: $%d ~b~Sale price: $%d ~n~ ~g~Earn ammount: $%d~n~~w~Owner: %s(%d)", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn], Pname, BusinessInfo[C][BusOwner]);
                GameTextForPlayer(playerid, str, 3000, 3);
            }
           
        }
    }
    return 1;
}
and yes all the variables in the code do work properly, so any ideas as to why it doesnt display anything when i walk through the pickup?
Reply
#2

Are you sure the pickupid is 1272... ?
I believe that's the model, not the ID.
Reply
#3

nope i just seached up on wiki and 1272 is a blue house icon, i can see the pickup just nothing happens when i walk into it
Reply
#4

After adding pickups (AddStaticPickup), they get assigned to an ID.
First pickup's ID = 0, next one's 1 etc..

I recommend making a global variable called something like "myPickup", then when you use AddStaticPickup, assign myPickup to it.

pawn Код:
myPickup = AddStaticPickup( stuff );
So then you can du
pawn Код:
if( pickupid == myPickup )
Reply
#5

damn, unfortunetly it still isnt working, i just tried that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)