House system whit slots, how to add car system
#1

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.
Reply
#2

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
Reply
#3

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?
Reply
#4

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

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
Reply
#6

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)
Reply
#7

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)
Reply
#8

What system you're using to save/load?
Reply
#9

Me using SII
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)