How to check if someone is house owner
#4

Hmm. I wanted it so if a house row owned by a player is deleted in the database and the player has the house id (PlayerInfo[playerid][pHouse]) in their variable, it lets them know via message.

I added this into where my players log in and it doesn't send the message when I buy a house and delete the row:

pawn Код:
new id = PlayerInfo[playerid][pHouse];

    if(PlayerInfo[playerid][pHouse] >= 0)
    {
        if(strcmp(Player(playerid), HouseInfo[id][hOwner], false) == 0)
        {
            SendClientMessage(playerid, COLOR_ORANGE, "You have been removed as ownership from your house.");
        }
    }
I use Player(playerid) to set the owner of the house

pawn Код:
stock Player(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
Thanks
Reply


Messages In This Thread
How to check if someone is house owner - by AphexCCFC - 29.04.2014, 01:21
Re: How to check if someone is house owner - by Dignity - 29.04.2014, 01:27
Respuesta: Re: How to check if someone is house owner - by Swedky - 29.04.2014, 01:33
Re: How to check if someone is house owner - by AphexCCFC - 29.04.2014, 01:48

Forum Jump:


Users browsing this thread: 2 Guest(s)