SA-MP Forums Archive
House help - 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: House help (/showthread.php?tid=350315)



House help - trapstar2020 - 12.06.2012

Okay I set a player to have 1house key but i want to create a donate were I am able to
Код:
/upgrade [id] housekey [amount]
And the player would now be able to have more house keys for the amount i enter in the dini info


Re: House help - leonardo1434 - 12.06.2012

Dude dude dude... We are not a kid of magician to know how your house system is set...

At least try make it yourself, then post here the bugs...


AW: House help - Extremo - 12.06.2012

Use two arrays, one holds the keys, one is a boolean like this:

pawn Код:
enum HouseInfo /* or whatever u haz */
{
    bool:KeyEnable[MAX_KEYS],
    Keys[MAX_KEYS]
};

/* then in your command u check if KeyEnable[KEYID] and if it is, you allow him to have a key on that array
    and in order for you to check if he still has keys left u just loop through MAX_KEYS and check if theres one
    which is KeyEnable but Keys is not set yet. Simple.
*/