/createhouse <address> not working
#10

Quote:
Originally Posted by kirollos
Посмотреть сообщение
i believe your code won't work as you always set it to the house id 1:

i have made this but i hope it can fit your code:

pawn Код:
CMD:createhouse(playerid, params[])
{
    new string[128], Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(isnull(params)) return SendClientMessage(playerid, -1, ""Grey"Syntax"White": /createhouse [address]."); // checks if params was null so it gives the error
    for(new houseid=1; houseid<MAX_HOUSES; houseid++)
    {
        if(HouseInfo[houseid][hid] != 0) continue; // if the houseid wasnt 0 (if it was already existed) as the loop already starts with id 1, so it skips.
        HouseInfo[houseid][hID] = houseid; // i dont know how come that will work but ok.
        format(HouseInfo[houseid][hAddress], 30, "%s", params); // Sets the address
        format(HouseInfo[houseid][hOwner], 32, "None");
        HouseInfo[houseid][hOwned] = 0;
        HouseInfo[houseid][hPickUp] = CreateDynamicPickup(1273, 1, x, y, z, 0);
        format(string, sizeof(string), ""Green"ID: %d\nHouse Address: %s", houseid, HouseInfo[houseid][hAddress]);
        HouseInfo[houseid][hText] = CreateDynamic3DTextLabel(string, -1, x, y, z, 20.0);
        //houseid = MAX_HOUSES;  // break can be better than this
        break;
    }
    return 1;
}
Thanks, I've tried this. It has fixed my ID bug where it only kept making houses as ID 1 but not my address issue.
Here is what happens when I type "/createhouse test"

Reply


Messages In This Thread
/createhouse <address> not working - by AphexCCFC - 12.09.2013, 20:58
Re: /createhouse <address> not working - by park4bmx - 12.09.2013, 21:11
Re: /createhouse <address> not working - by FiReAlEx - 12.09.2013, 21:14
Re: /createhouse <address> not working - by AphexCCFC - 12.09.2013, 21:14
Re: /createhouse <address> not working - by FiReAlEx - 12.09.2013, 21:16
Re: /createhouse <address> not working - by AphexCCFC - 12.09.2013, 21:17
Re: /createhouse <address> not working - by FiReAlEx - 12.09.2013, 21:21
Re: /createhouse <address> not working - by AphexCCFC - 12.09.2013, 21:32
Re: /createhouse <address> not working - by Kirollos - 12.09.2013, 22:50
Re: /createhouse <address> not working - by AphexCCFC - 12.09.2013, 23:03

Forum Jump:


Users browsing this thread: 1 Guest(s)