SA-MP Forums Archive
House system whit slots, how to add car system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: House system whit slots, how to add car system (/showthread.php?tid=276108)



House system whit slots, how to add car system - [HUN]Poldzsiii - 12.08.2011

Hello everyone.

Me sucesfully created my own house system, with Carslots. Created whit SII.
I don't know how to start my own car system.I need attach 3DText to owned cars. Anyone can help me?
1 slots = 1 cars
2 slots = 2 cars
...
5 slots = 5 cars
etc..

Sorry for bad english.


Re: House system whit slots, how to add car system - Riddick94 - 12.08.2011

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel


Re: House system whit slots, how to add car system - [HUN]Poldzsiii - 12.08.2011

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
I know how to make 3D Text label. I don't know how to start my vehicle system, how to create?


Re: House system whit slots, how to add car system - Riddick94 - 12.08.2011

What do you need to this vehicle system. Saving pos, id, colour?


Re: House system whit slots, how to add car system - [HUN]Poldzsiii - 12.08.2011

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
What do you need to this vehicle system. Saving pos, id, colour?
Saving, pos, id, colour, owner. No more. And slots


Re: House system whit slots, how to add car system - Riddick94 - 12.08.2011

pawn Код:
#include    "a_samp"
#include    "zcmd"

#undef  MAX_PLAYERS
#define MAX_PLAYERS         (50) // Max server slots.

enum vInfo
{
    pVehicleID,
    pVehicleColour,
    pVehicleColour2,
    pVehicleLocked,

    Float:pVehX,
    Float:pVehY,
    Float:pVehZ,
    Float:pVehAngle
};
new VehicleInfo[MAX_PLAYERS][vInfo];

public OnPlayerConnect(playerid)
{
    VehicleInfo[playerid][pVehicleID] = -1;
    VehicleInfo[playerid][pVehicleColour] = -1;
    VehicleInfo[playerid][pVehicleColour2] = -1;
    VehicleInfo[playerid][pVehicleLocked] = -1;
   
    VehicleInfo[playerid][pVehX] = 0.0;
    VehicleInfo[playerid][pVehY] = 0.0;
    VehicleInfo[playerid][pVehZ] = 0.0;
    VehicleInfo[playerid][pVehAngle] = 0.0;
   
    /*
    Loading everything from your file system.
    */

    return true;
}

public OnPlayerDisconnect(playerid, reason)
{
    /*
    Saving all to your file system.
    */

   
    VehicleInfo[playerid][pVehicleID] = -1;
    VehicleInfo[playerid][pVehicleColour] = -1;
    VehicleInfo[playerid][pVehicleColour2] = -1;
    VehicleInfo[playerid][pVehicleLocked] = -1;

    VehicleInfo[playerid][pVehX] = 0.0;
    VehicleInfo[playerid][pVehY] = 0.0;
    VehicleInfo[playerid][pVehZ] = 0.0;
    VehicleInfo[playerid][pVehAngle] = 0.0;
    return true;
}

CMD:park(playerid, params[])
{
    new Float:X, Float:Y, Float:Z, Float:Angle;
    GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
    GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
   
    VehicleInfo[playerid][pVehX] = X;
    VehicleInfo[playerid][pVehX] = Y;
    VehicleInfo[playerid][pVehX] = Z;
    VehicleInfo[playerid][pVehAngle] = Angle;
   
    VehicleInfo[playerid][pVehicleID] = GetVehicleModel(GetPlayerVehicleID(playerid));
   
    SendClientMessage(playerid, -1, "* Vehicle parked.");
    return true;
}
To save vehicle colour just save it as normal and then when player connect create vehicle with variable. (In disconnect just save it)


Re: House system whit slots, how to add car system - [HUN]Poldzsiii - 12.08.2011

Nice, thanx. I have question. How to save? By vehicleid, owner name or another..?
And how to attach 3D Text for owned vehicles?
Ex:"NRG-500 Owner: Riddick94"
And how to add to slots?
Load slots at my own script:
pawn Код:
HouseData[houseid][Slots] = INI_ReadInt("Slots");
And when player enter owned veh (not owned by playerid)


Re: House system whit slots, how to add car system - Riddick94 - 12.08.2011

What system you're using to save/load?


Re: House system whit slots, how to add car system - [HUN]Poldzsiii - 12.08.2011

Me using SII


Re: House system whit slots, how to add car system - Riddick94 - 12.08.2011

Give me this script on PM. Because i never using before SII only DINI, DJSon, Y_Ini. I need to check this how you made that.