SA-MP Forums Archive
Function bugged. - 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: Function bugged. (/showthread.php?tid=542868)



Function bugged. - Baltimore - 22.10.2014

Hello.

This function is used to return whether or not I own a house.

However, if I do not have a house it returns me that I have a ...

And if I have one, it also returns me that I have a ...

How?

pawn Код:
forward House_Proprio(playerid, iddhouse);
public House_Proprio(playerid, iddhouse)
{
    if(iddhouse == -1)
    {
        return 0;
    }
    if(strcmp(NameRequete[playerid], HouseInfo[iddhouse][Proprio], true) == 0)
    {
        return 1;
    }
    return 0;
}



Re: Function bugged. - Jefff - 22.10.2014

add
pawn Код:
if(HouseInfo[iddhouse][Proprio][0] == EOS) return 0;
or

pawn Код:
if(HouseInfo[iddhouse][Proprio][0] && strcmp(NameRequete[playerid], HouseInfo[iddhouse][Proprio], true) == 0)



Re: Function bugged. - TakeiT - 22.10.2014

pawn Код:
forward House_Proprio(playerid, iddhouse);
public House_Proprio(playerid, iddhouse)
{
    if(iddhouse == -1)
    {
        return 0;
    }
    if(!strcmp(NameRequete[playerid], HouseInfo[iddhouse][Proprio])) //this line, added the ! at the beginning.
    {
        return 1;
    }
    return 0;
}