loop not working properly?Again...
#10

Yes, we are not here to spoon feed you code, you're meant to do that yourself with our help.
Feeding you the code is not the point of this community. Anyways...
This what I mean
pawn Код:
CMD:npirkti(playerid,params[])
{
    new h = -1; // house id
    for ( ; h < MAX_HOUSES; h++)
    {
        if (IsPlayerInRangeOfPoint(playerid, 5, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]))
            break;
    }
    if (h != -1)
    {
        if (!strcmp(HouseInfo[h][hOwnerName], pName, false))
        {
            if (HouseInfo[h][hOwned] == 0)
            {
                if (GetPlayerMoney(playerid) > HouseInfo[h][hPrice])
                {
                    strmid(HouseInfo[h][hOwnerName], pName, 0, strlen(pName),MAX_PLAYER_NAME);
                    HouseInfo[h][hOwned] = 1;
                    GivePlayerMoney(playerid,-HouseInfo[h][hPrice]);
                    SendClientMessage(playerid, COL_RED,"Sveikiname, nusipirkote nama! Visas komandas rasite /namai."); // Congratz you bought the house!
                    HouseInfo[h][hIsRented] = 0;
                    new labelstring[500];
                    DestroyDynamic3DTextLabel(HouseInfo[h][hLabel]);
                    DestroyDynamicMapIcon(HouseInfo[h][hIcon]);
                    DestroyDynamicPickup(HouseInfo[h][hPickup]);

                    format(labelstring, sizeof(labelstring),""TCCYAN"Savininkas: "TCRED"%s\n"TCCYAN"Nuoma: "TCRED"%s\n"TCCYAN"Nuomos kaina: "TCRED"%d\n"TCCYAN"Adresas: "TCRED"%s", HouseInfo[h][hOwnerName],HouseInfo[h][hRenter],HouseInfo[h][hRentPrice],HouseInfo[h][hAddress]);
                    HouseInfo[h][hLabel] = CreateDynamic3DTextLabel(labelstring, COL_GREEN, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 20);
                    HouseInfo[h][hPickup] = CreateDynamicPickup(1272, 1, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]);
                    HouseInfo[h][hIcon] = CreateDynamicMapIcon(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 32, 0,0);
                    SaveHouseData(h);
                    return 1;
                }
                else SendClientMessage(playerid, COL_RED, "Jums neuztenka pinigu ipirkti siam namui!"); //You dont have enough money to buy this house
            }
            else SendClientMessage(playerid, COL_RED, "Sis namas jau nupirktas!Jei jis nuomuojamas gali ji nuomuoti.");  //This house is already bought , yuo can rent it if its rentable
        }
        else SendClientMessage(playerid, COL_RED, "Tu jau turi namus!"); // You already have house
    }
    else SendClientMessage(playerid, COL_RED, "Jus nesate prie parduodamo namo!"); // You're not a near house that is sellable
    return 1;
}
Reply


Messages In This Thread
loop not working properly?Again... - by Dziugsas - 04.07.2014, 12:18
Re: loop not working properly?Again... - by Dziugsas - 04.07.2014, 13:32
Re: loop not working properly?Again... - by BroZeus - 04.07.2014, 13:41
Re: loop not working properly?Again... - by Dziugsas - 04.07.2014, 13:41
Re: loop not working properly?Again... - by Dziugsas - 04.07.2014, 13:43
Re: loop not working properly?Again... - by Virtual1ty - 04.07.2014, 13:43
Re: loop not working properly?Again... - by Dziugsas - 04.07.2014, 13:46
Re: loop not working properly?Again... - by Virtual1ty - 04.07.2014, 13:47
Re: loop not working properly?Again... - by Dziugsas - 04.07.2014, 13:50
Re: loop not working properly?Again... - by Virtual1ty - 04.07.2014, 13:55

Forum Jump:


Users browsing this thread: 1 Guest(s)