[Tutorial] Make your own house system (with vehicles)
#30

pawn Code:
dcmd_sellhouse(playerid, params[])
{
    #pragma unused params
   
    for(new h = 0; h < MAX_HOUSES; h++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[h][hEntrancePosX], HouseInfo[h][hEntrancePosY], HouseInfo[h][hEntrancePosZ]))
        {
            new pName[MAX_PLAYER_NAME],string[128];GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            if(!strcmp(HouseInfo[h][hOwner], pName, false) && HouseInfo[h][hOwned] == 1) //You have to be the owner of the house ;) (the only problem is, if you are using someone elses name, you can sell it too, but you can integrate this script with another script of course ;)
            {
                HouseInfo[h][hOwned] = 0;
                strdel(HouseInfo[h][hOwner], 0, strlen(HouseInfo[h][hOwner]));
                GivePlayerMoney(playerid, (HouseInfo[h][hPrice]/2)); //Let's return the half of the price
                DestroyMapIcon(HOUSE_ICON[h]); DestroyPickup(HOUSE_PICKUP[h]);
                HOUSE_ICON[h] = CreateMapIcon(31, 0, HouseInfo[h][hEntrancePosX], HouseInfo[h][hEntrancePosY], HouseInfo[h][hEntrancePosZ]);
                HOUSE_PICKUP[h] = CreatePickup(1272, 1, HouseInfo[h][hEntrancePosX], HouseInfo[h][hEntrancePosY], HouseInfo[h][hEntrancePosZ]);
                format(string, sizeof(string), "** %s has selled a house", pName);
                SendClientMessageToAll(0x00FF00AA, string);
                SaveAllHouses();
                return 1;
            }
            else return SendClientMessage(playerid, 0xFF0000AA, "** You can only sell your own houses ;)");
        }
    }
    return 1;
}
And this? I don't have time to compile/test it xD
Reply


Messages In This Thread
Make your own house system (with vehicles) - by Kwarde - 25.09.2010, 21:28
Re: Make your own house system (with vehicles) - by Luis- - 25.09.2010, 22:27
Re: Make your own house system (with vehicles) - by [4k]Wang - 25.09.2010, 22:31
Re: Make your own house system (with vehicles) - by willsuckformoney - 25.09.2010, 23:24
Re: Make your own house system (with vehicles) - by Kwarde - 26.09.2010, 06:20
Re: Make your own house system (with vehicles) - by willsuckformoney - 26.09.2010, 06:22
Re: Make your own house system (with vehicles) - by Kwarde - 26.09.2010, 06:23
Re: Make your own house system (with vehicles) - by Basicz - 27.09.2010, 06:53
Re: Make your own house system (with vehicles) - by HyperZ - 27.09.2010, 10:11
Re: Make your own house system (with vehicles) - by Mr.Jvxmc - 29.09.2010, 20:14
Re: Make your own house system (with vehicles) - by Kwarde - 30.09.2010, 04:31
Re: Make your own house system (with vehicles) - by Kwarde - 01.10.2010, 18:41
Re: Make your own house system (with vehicles) - by Mujib - 29.10.2010, 21:36
Re: Make your own house system (with vehicles) - by toneysix - 04.11.2010, 17:08
Re: Make your own house system (with vehicles) - by Kwarde - 04.11.2010, 19:57
Re: Make your own house system (with vehicles) - by [H]265 - 04.11.2010, 20:01
Re: Make your own house system (with vehicles) - by TouR - 07.11.2010, 08:03
Re: Make your own house system (with vehicles) - by Kwarde - 07.11.2010, 08:04
Re: Make your own house system (with vehicles) - by Aleluja - 08.11.2010, 06:54
Re: Make your own house system (with vehicles) - by [H]265 - 08.11.2010, 08:36
Re: Make your own house system (with vehicles) - by ••• ĤБĶБM ••• - 08.11.2010, 15:36
Re: Make your own house system (with vehicles) - by sjvt - 08.11.2010, 16:04
Re: Make your own house system (with vehicles) - by Kwarde - 08.11.2010, 16:42
Re: Make your own house system (with vehicles) - by sjvt - 08.11.2010, 16:49
Re: Make your own house system (with vehicles) - by Kwarde - 08.11.2010, 17:34
Re: Make your own house system (with vehicles) - by CSMajor - 08.11.2010, 22:18
Re: Make your own house system (with vehicles) - by DaneAMattie - 09.11.2010, 13:39
Re: Make your own house system (with vehicles) - by Kwarde - 11.11.2010, 17:48
Re: Make your own house system (with vehicles) - by DaneAMattie - 11.11.2010, 17:54
Re: Make your own house system (with vehicles) - by Kwarde - 11.11.2010, 18:18
Re: Make your own house system (with vehicles) - by DaneAMattie - 11.11.2010, 18:23
Re: Make your own house system (with vehicles) - by Kwarde - 11.11.2010, 19:07
Re: Make your own house system (with vehicles) - by DaneAMattie - 11.11.2010, 20:41
Re: Make your own house system (with vehicles) - by TheHoodRat - 12.11.2010, 17:13
Re: Make your own house system (with vehicles) - by Jantjuh - 17.11.2010, 19:59
Re: Make your own house system (with vehicles) - by sjvt - 17.11.2010, 23:23
Re: Make your own house system (with vehicles) - by doreto - 25.11.2010, 12:10
Re: Make your own house system (with vehicles) - by Ricardo187 - 12.12.2010, 19:36
Re : Make your own house system (with vehicles) - by pseudonyme - 11.08.2012, 19:02
Re: Make your own house system (with vehicles) - by Qur - 11.08.2012, 19:40
Re: Re : Make your own house system (with vehicles) - by Kwarde - 11.08.2012, 21:21
Re: Make your own house system (with vehicles) - by Qur - 12.08.2012, 03:33
Re: Make your own house system (with vehicles) - by Weaselpwns - 12.08.2012, 08:59
Re : Make your own house system (with vehicles) - by Sandiel - 13.08.2012, 22:04
Re: Make your own house system (with vehicles) - by TaLhA XIV - 13.08.2012, 23:30
Re: Make your own house system (with vehicles) - by T_Boy - 26.08.2012, 11:48
Re: Make your own house system (with vehicles) - by Kwarde - 26.08.2012, 11:50
Re: Make your own house system (with vehicles) - by Kwarde - 18.04.2014, 12:07
Re: Make your own house system (with vehicles) - by Yves - 18.04.2014, 12:10
Re: Make your own house system (with vehicles) - by Kwarde - 18.04.2014, 12:43
Re: Make your own house system (with vehicles) - by mrkiller90 - 18.04.2014, 12:43
Re: Make your own house system (with vehicles) - by Kwarde - 18.04.2014, 12:52
Re: Make your own house system (with vehicles) - by mrkiller90 - 18.04.2014, 13:00
Re: Make your own house system (with vehicles) - by Kwarde - 18.04.2014, 14:33
Re: Make your own house system (with vehicles) - by danish007 - 19.04.2014, 15:30
Re: Make your own house system (with vehicles) - by iRaiDeN - 20.04.2014, 07:48
Re: Make your own house system (with vehicles) - by Giannidw - 22.04.2014, 05:07
Re: Make your own house system (with vehicles) - by rockhopper - 14.06.2014, 15:43
Re: Make your own house system (with vehicles) - by rockhopper - 15.06.2014, 05:14
Re: Make your own house system (with vehicles) - by rockhopper - 16.06.2014, 14:07
Re: Make your own house system (with vehicles) - by Kwarde - 20.06.2014, 16:10
Re: Make your own house system (with vehicles) - by rockhopper - 21.06.2014, 14:10
Re: Make your own house system (with vehicles) - by victorcast - 26.06.2014, 22:39
Re: Make your own house system (with vehicles) - by Dangjai - 26.06.2014, 23:01
Re: Make your own house system (with vehicles) - by Arxalan - 01.01.2015, 06:12
Re: Make your own house system (with vehicles) - by Kwarde - 01.01.2015, 08:51
Re: Make your own house system (with vehicles) - by nicholasramdhan - 01.01.2015, 09:24
Re: Make your own house system (with vehicles) - by shadow177 - 05.01.2015, 06:10
Re: Make your own house system (with vehicles) - by Arxalan - 08.01.2015, 12:29
Re: Make your own house system (with vehicles) - by Wipe - 08.01.2015, 13:03
Re: Make your own house system (with vehicles) - by DTV - 16.01.2015, 23:28
Respuesta: Make your own house system (with vehicles) - by Tween73 - 06.12.2015, 13:47
Re: Make your own house system (with vehicles) - by Kwarde - 19.01.2016, 10:24
Re: Make your own house system (with vehicles) - by Joron - 20.01.2016, 01:56
Re: Make your own house system (with vehicles) - by SundayMorning - 17.05.2017, 07:28
Re: Make your own house system (with vehicles) - by Kimsa - 20.05.2017, 11:57
Re: Make your own house system (with vehicles) - by JohnFlores - 24.07.2017, 14:15
Re: Make your own house system (with vehicles) - by Kwarde - 20.08.2017, 20:45
Re: Make your own house system (with vehicles) - by cuber - 20.08.2017, 20:51
Re: Make your own house system (with vehicles) - by TheCman - 20.08.2017, 21:53

Forum Jump:


Users browsing this thread: 5 Guest(s)