SA-MP Forums Archive
Unlimited house buying or etc. - 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: Unlimited house buying or etc. (/showthread.php?tid=388683)



Unlimited house buying or etc. - ||123|| - 29.10.2012

Is it possible to allow a player to buy unlimited houses he wants. Instead of creating different variables for the player's house and house number in the player file, like 'house1 = %d', 'house2 = %d'.


Re : Unlimited house buying or etc. - lelemaster - 30.10.2012

Make a loop of all your houses and check if the owner and the player's name are the same.

example:

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
for(new i = 0; i<sizeof(Your_Variable);i++)
{
    if(strcmp(name, Your_Variable, false) == 0)
    {
        //your codes
    }
}