how to limit buy houses in SasinosoftHouse FS
#1

hello

how to limit buy houses in SasinosoftHouse FS

like player only can buy only 2 houses and not more

https://sampforum.blast.hk/showthread.php?tid=405201
Reply
#2

Try this:

pawn Код:
#define MAX_PER_PLAYER 2

new HousesPurchased[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    HousesPurchashed[playerid] = 0;
    return 1;
}

//in the /buy command add
if(HousesPurchased[playerid] < MAX_PER_PLAYER)
{

}
else return SendClientMessage(playerid, -1, "You can only have 2 houses in total.");

//in the onplayerconnect, do a search through all houses to see if they match the owner name, then call:

HousesPurchased[playerid]++;

//If it >= 2, then set it to 2. You should be done then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)