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



House Question - Dr - 16.09.2011

Hello,

pawn Код:
hBuyer[MAX_PLAYER_NAME],
I have that, how would I use that to check if the player using the command /rentable is the owner or not? Thanks.


Re: House Question - StuffBoy - 16.09.2011

pawn Код:
stock IsPlayerOwner()
{
     if(hBuyer[playerid] != houseowner) // you have to use your house var or enum to make it also loop all houses
     {
          return 1;
     }
     return 0;
}



Re: House Question - Dr - 16.09.2011

..No that isnt what I am looking for, I want umm something like this:
pawn Код:
if(HouseInfo[idx][hOwner] == playername)
This is my hOwner thing:
pawn Код:
strmid(HouseInfo[idx][hOwner], arrCoords[8], 0, strlen(arrCoords[8]), 255);
Would that kind of thing work, and how would I script it?


Re: House Question - EvoRP - 16.09.2011

Got the same problem.


Re: House Question - =WoR=Varth - 16.09.2011

For comparing string.
https://sampwiki.blast.hk/wiki/Strcmp


Re: House Question - Dr - 16.09.2011

No but I am saying what is a way to check if a house is owned by a player or not with my current code?


Re: House Question - =WoR=Varth - 16.09.2011

Yes it is.
pawn Код:
if(!strcmp(HouseInfo[idx][hOwner],playername));