IsHouseOwnerOnline - 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: IsHouseOwnerOnline (
/showthread.php?tid=547189)
IsHouseOwnerOnline -
Juvanii - 21.11.2014
Would somebody tell me why it doesn't work?
pawn Код:
stock IsHouseOwnerOnline(houseid)
{
new count = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!strcmp(HouseInfo[houseid][HouseOwner], GetName(i), true)) count ++;
}
if(count > 0) return 1;
return 0;
}
Re: IsHouseOwnerOnline -
CoaPsyFactor - 21.11.2014
if HouseInfo[houseid][HouseOwner] is right value, this should work.
Note: I didn't compiled it, but still it should do
pawn Код:
stock IsHouseOwnerOnline(houseid)
{
new owner_name[MAX_PLAYER_NAME];
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if (!IsPlayerConnected(playerid))
{
continue;
}
GetPlayerName(playerid, owner_name, sizeof(owner_name));
if (!strcmp(HouseInfo[houseid][HouseOwner], owner_name, true))
{
return 1;
}
}
return 0;
}