Problems with for()
#1

Hello,

I created a little Bizz & House System for my server. Everything is working fine but this part. I wrote this under OnPlayerPickupPickup, but it doesn't seem to work:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new bid = 0; bid < sizeof(BizzInfo) ; bid++)
    {
        if(pickupid == BizzInfo[bid][BPick])
        {
            new string[164];

            if(BizzInfo[bid][HasOwner] == 0)
            {
                format(string,sizeof(string),"~w~Name: ~y~%s~n~~w~Besitzer: ~g~Keiner~n~~r~/bizzinfo",BizzInfo[bid][Name]);
                GameTextForPlayer(playerid,string,2500,3);
            }
            else if(BizzInfo[bid][HasOwner] == 1)
            {
                format(string,sizeof(string),"~w~Name: ~y~%s~n~~w~Besitzer: ~g~%s~n~~r~/bizzinfo",BizzInfo[bid][Name],BizzInfo[bid][Owner]);
                GameTextForPlayer(playerid,string,2500,3);
            }
        }
    }
   
    for(new hid = 0; hid < sizeof(HouseInfo) ; hid++)
    {
        if(pickupid == HouseInfo[hid][HPick])
        {
            new string[164];

            if(HouseInfo[hid][HasOwner] == 0)
            {
                format(string,sizeof(string),"~w~Besitzer: ~g~Keiner~n~~y~ID: %d~n~~r~/hausinfo",HouseInfo[hid][ID]);
                GameTextForPlayer(playerid,string,2500,3);
            }
            else if(HouseInfo[hid][HasOwner] == 1)
            {
                format(string,sizeof(string),"~w~Besitzer: ~g~%s~n~~y~ID: %d~n~~r~/hausinfo",HouseInfo[hid][Owner],HouseInfo[hid][ID]);
                GameTextForPlayer(playerid,string,2500,3);
            }
        }
    }
return 1;
}
# The variables BizzInfo and HouseInfo are defined at a other part of the script. Don't worry about them.


So I don't really know how to do this or what is wrong with the code.

Anyway, thanks in advance
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
OK, well what would help is telling us what it's meant to do and what it does do. Just saying "it doesn't work" is no help as we've got no way of knowing what it should be doing that it isn't.
Well it is supposed to display a GameText, showing some informations about the Bizz / House to a player.


BizzInfo[bid][BPick] = The pickup for businesses

HouseInfo[hid][HPick] = The pickup for houses


So far, it only works for one pickup. That means it does display the informations for a house pickup, but not those for a business pickup when you pick them up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)