Evict Renter Command
#1

Hello. I am trying to make it so if you type "/evictrenter" near the house it will evict the person who rents there even if they're offline, here is what I have:

pawn Код:
CMD:evictrenter(playerid, params[])
{
    new string[128];
    new h = Player[playerid][Houseid];
    new c = GetClosetHouseID(playerid);
    if(h == 999) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You don't have a house.");
    if(!IsPlayerInRangeOfPoint(playerid,1.0,House[h][EnterX],House[h][EnterY],House[h][EnterZ])) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not outside near your house.");
    if(strcmp(House[h][Player_Rent],"Nobody", false ) == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: No one is lodging at your house.");
    foreach(Player, renter)
    {
        if(Player[renter][RentHouseID] == c)
        {
            if(IsPlayerLoggedIn(renter))
            {
                format(string, sizeof(string), "Information{FFFFFF}: %s has evicted you from their house.", GetName(playerid));
                SendClientMessage(playerid, COLOR_ORANGE, string);
            }
            Player[renter][RentHouseID] = 999;
            PlayerInfo[renter][pRenting] = 0;
            UpdatePlayerInformation(renter);
            format(string, sizeof(string), "Information{FFFFFF}: You have evicted %s from your house.", GetName(renter));
            SendClientMessage(playerid, COLOR_ORANGE, string);
            format(House[h][Player_Rent], 32, "None");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: No one is renting this house.");
            return 1;
        }
    }
    return 1;
}
Thank you, I will +rep.
Reply


Messages In This Thread
Evict Renter Command - by AphexCCFC - 11.01.2013, 18:24
Re: Evict Renter Command - by Infinity90 - 11.01.2013, 18:25
Respuesta: Evict Renter Command - by Fabio11 - 11.01.2013, 18:27
Re: Evict Renter Command - by AphexCCFC - 11.01.2013, 18:29
Respuesta: Evict Renter Command - by Fabio11 - 11.01.2013, 18:30
Re: Evict Renter Command - by AphexCCFC - 11.01.2013, 18:32
Re: Evict Renter Command - by Jay_Dixon - 11.01.2013, 18:37
Re: Evict Renter Command - by AphexCCFC - 11.01.2013, 18:54
Re: Evict Renter Command - by Infinity90 - 11.01.2013, 19:14
Re: Evict Renter Command - by Steven82 - 11.01.2013, 19:37

Forum Jump:


Users browsing this thread: 1 Guest(s)