Posts: 134
Threads: 7
Joined: Oct 2010
Reputation:
0
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.
Posts: 1,767
Threads: 124
Joined: Mar 2010
Posts: 1,767
Threads: 124
Joined: Mar 2010
What do you need to this vehicle system. Saving pos, id, colour?
Posts: 1,767
Threads: 124
Joined: Mar 2010
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)
Posts: 1,767
Threads: 124
Joined: Mar 2010
What system you're using to save/load?
Posts: 1,767
Threads: 124
Joined: Mar 2010
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.