IsHouseOwnerOnline
#1

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;
}
Reply
#2

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)