SA-MP Forums Archive
Tell me whats wrong in this - 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: Tell me whats wrong in this (/showthread.php?tid=336078)



Tell me whats wrong in this - ||123|| - 21.04.2012

The code is creating confusion of a owned and unowned house. It's not even sometimes showing a gametext onpickuppickup

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new string[128];
    for(new h=0; h<sizeof(HouseInfo); h++)
    {
        if(pickupid == housepickup[h])
        {
            if(HouseInfo[h][hOwned])
            {
                format(string,sizeof(string), "~w~%s~n~~w~%s~n~~y~%d", HouseInfo[h][hOwner], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            else
            {
                format(string,sizeof(string), "~w~[House For Sale]~n~Price:~r~$%d~n~~w~%s~n~~y~%d", HouseInfo[h][hPrice], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            GameTextForPlayer(playerid, string, 5000, 5);
            return 1;
        }
    }
    return 1;
}



Re: Tell me whats wrong in this - Face9000 - 21.04.2012

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new string[128];
    new string2[128];
    for(new h=0; h<sizeof(HouseInfo); h++)
    {
        if(pickupid == housepickup[h])
        {
            if(HouseInfo[h][hOwned])
            {
                format(string,sizeof(string), "~w~%s~n~~w~%s~n~~y~%d", HouseInfo[h][hOwner], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            else
            {
                format(string2,sizeof(string2), "~w~[House For Sale]~n~Price:~r~$%d~n~~w~%s~n~~y~%d", HouseInfo[h][hPrice], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            GameTextForPlayer(playerid, string, 5000, 5);
            GameTextForPlayer(playerid, string2, 5000, 5);
            return 1;
        }
    }
    return 1;
}
I got the same problem with 1 string having 2 differents uses.Try that.


Re: Tell me whats wrong in this - ||123|| - 22.04.2012

Not working. It's kind of bugged, sometimes it creates a pickup shoing the house isn't owned and sometimes it shows that it is, even though the variable in the userfile says it is!