Temas similares


    [FilterScript] PPC_Housing

    Compartir

    Admin
    Admin
    Admin

    Capricornio Mensajes: 440
    Fecha de inscripción: 13/02/2011

    [FilterScript] PPC_Housing

    Mensaje  Admin el Sáb Nov 19, 2011 1:24 pm

    I've just completed my revised/updated housing system as a filterscript and it's finally here.

    NOTE: Do NOT use this script together with the PPC_Trucking gamemode.
    The gamemode has the housing system built-in and both systems will
    collide with eachother, as they both use the same commands and dialogs.



    The system is quite easy to use.
    Just install the script in your filterscripts folder and add it to your server.cfg file.
    Also add a new folder called "PPC_Housing" in your scriptfiles folder, this is where the houses are saved and loaded.

    The filterscript uses Incognito's streamer for the pickups and 3DText labels, so you need it for this script to work.
    [Tienes que estar registrado y conectado para ver este vínculo]
    It also uses sscanf (I'm still using an older version, as I still use Samp 0.3c):
    [Tienes que estar registrado y conectado para ver este vínculo]
    And zcmd is also required:
    [Tienes que estar registrado y conectado para ver este vínculo]

    If used together with my Speedometer script, both scripts communicate with eachother (you'll need the latest version for this).
    Both scripts work separately too, so don't worry if you want to use only one of them.

    This housing system has 2 different types of houses:
    - normal houses (they work the same way as in my gamemode: PPC_Trucking):
    Those houses start at level 1 when you buy them and they will have only 1 carslot.
    Players can upgrade their houses to change their interior and to increase the amount of carslots.
    Houses can have a maximum level of 10. When you create a house, you can set the maximum level to any value between 1 and 10.

    - static houses:
    These houses have a fixed interior (you set the interior when you create
    the house, they use the same interiors as the normal house's levels),
    so you could also say they have a fixed level. These houses cannot be
    upgraded.
    They also have a fixed amount of carslots that can't be upgraded.
    They have all the same features (rename house, open to public, close to
    public, buy housecars, ...) as normal houses, except for upgrading.


    To create a normal (upgradable) house, use the command: /createhouse
    To create a static house, use the command: /createstatichouse
    You can always use the /delhouse command to delete a house that's still for sale, you cannot delete a house that has an owner.

    To buy a house, use the /buyhouse command. You need to stand within 2.5m of the entrance (green house-pickup).
    To enter your house, stand near your house's entrance and use the command /enter.
    To access all house-features, use the /housemenu command.

    Exiting the house can also be done through the housemenu.



    Car-tunings are also saved in your housefile, so no worries to lose all your vehiclecomponents when you logout.
    All vehicles have a price of $50.000, adjust those prices to your needs in the ABuyableVehicles array, which starts at line 188.



    Also, there are a few functions that you need to copy and modify to your
    gamemode or other filterscripts if you use server-sided money.
    The filterscript normally has no access to your account-data that your
    gamemode might hold, but these functions allow the housing script to get
    data from your gamemode if you copy them to your gamemode.
    They are near the bottom of the filterscript.

    If you don't copy and edit them, the script will automatically use client-sided money.






















    [center]pawn Code:

    [center]
    // This function is used to get the player's money
    forward EXT_GetPlayerMoney(playerid);
    public EXT_GetPlayerMoney(playerid)
    {
    return APlayerData[playerid][PlayerMoney];
    }

    // This function is used to get the player's money
    forward EXT_GivePlayerMoney(playerid, Money);
    public EXT_GivePlayerMoney(playerid, Money)
    {
    // Add the given money to the player's account
    APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + Money;

    // Return that the function had success (another script holds the player's money on the server-side)
    return 1;
    }

    // This function is used to get the player's admin-level
    forward EXT_GetPlayerAdminLevel(playerid);
    public EXT_GetPlayerAdminLevel(playerid)
    {
    return APlayerData[playerid][AdminLevel];
    }

    // This function is used to determine if the player has logged in (he succesfully entered his password)
    forward EXT_IsPlayerLoggedIn(playerid);
    public EXT_IsPlayerLoggedIn(playerid)
    {
    if (APlayerData[playerid][LoggedIn] == true)
    return 1; // The player has logged in succesfully
    else
    return -1; // The player hasn't logged in (yet)
    }


    The inner workings of these functions are pretty much self-explanatory.
    You might need to edit the location of your data (pData[playerid][Money]
    for example, instead of APlayerData[playerid][PlayerMoney]).



    Screenshot (normal house on the left, static house on the right):
    [Tienes que estar registrado y conectado para ver esa imagen]

    Screenshot (inside the house, showing the housemenu):
    [Tienes que estar registrado y conectado para ver esa imagen]

    Download it here:
    [Tienes que estar registrado y conectado para ver este vínculo]

    __________________

    Gamemode: PPC_Trucking
    ----------------------------------------------------------






    [/center]

    [/center]

      Fecha y hora actual: Lun Mayo 21, 2012 5:16 am