31.12.2015, 12:05
(
Последний раз редактировалось yvoms; 01.01.2016 в 18:37.
)
Hello guys,
im in need of a heads up,
Im trying to edit my vehicle system to set the type,
certain vehicles for army certains for leo only this to be set in the database.
I have put it in a enum and defined the vehicle types, however im not sure on how to load the actual vehicle type.
Veh_type definitions
Vehicle enumrator
And the database structure
Load vehicles Query
And the vehicle load function
Patrick told me to load the veh_type OnPlayerEnterVehicle
if(vehicleid == rowid == veh_type)
But i have no clue on how this works,
So im hoping someone could assist me with this.
Veh_type 0 should do nothing,
Veh_type 1 Should give a player a message and +3 wanted level
Veh_type 2 Should give a player a message +3 wanted and eject from the vehicle.
I hope someone is able to help me with this as its needed very much on the gamemode.
Thanks in advance
Yvoms
im in need of a heads up,
Im trying to edit my vehicle system to set the type,
certain vehicles for army certains for leo only this to be set in the database.
I have put it in a enum and defined the vehicle types, however im not sure on how to load the actual vehicle type.
Veh_type definitions
Код:
#define VEHICLE_TYPE_GLOBAL (0) #define VEHICLE_TYPE_LEO (1) #define VEHICLE_TYPE_ARMY (2)
Код:
enum server_veh { ORM:ORM_ID, ID, Model, Color[2], Plate[MAX_PLATE_NAME], Float:Spawn[4], Type };
Код:
CREATE TABLE `server_vehicles` ( `veh_id` INT(5) NOT NULL, `veh_model` INT(5) NOT NULL, `veh_color_1` INT(5) NOT NULL, `veh_color_2` INT(5) NOT NULL, `veh_plate` VARCHAR(40) NOT NULL, `veh_x` FLOAT(12,4) NOT NULL, `veh_y` FLOAT(12,4) NOT NULL, `veh_z` FLOAT(12,4) NOT NULL, `veh_a` FLOAT(12,4) NOT NULL, `veh_type` INT(11) NULL DEFAULT '0', PRIMARY KEY (`veh_id`) ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB ;
Код:
mysql_pquery(Database,"SELECT * FROM `server_vehicles` ORDER BY `veh_id` ASC","Vehicle_Load","");
Код:
function Vehicle_Load() { new rows = cache_get_row_count(Database); if(rows != 0) { forex(row,rows) { new vehicleid = cache_get_row_int(row,0,Database); new ORM:ormid = ServerVehicle[vehicleid][ORM_ID] = orm_create("server_vehicles",Database); orm_addvar_int(ormid,ServerVehicle[vehicleid][ID],"veh_id"); orm_addvar_string(ormid,ServerVehicle[vehicleid][Plate],MAX_PLATE_NAME,"veh_plate"); orm_addvar_int(ormid,ServerVehicle[vehicleid][Model],"veh_model"); orm_addvar_int(ormid,ServerVehicle[vehicleid][Color][0],"veh_color_1"); orm_addvar_int(ormid,ServerVehicle[vehicleid][Color][1],"veh_color_2"); orm_addvar_float(ormid,ServerVehicle[vehicleid][Spawn][0],"veh_x"); orm_addvar_float(ormid,ServerVehicle[vehicleid][Spawn][1],"veh_y"); orm_addvar_float(ormid,ServerVehicle[vehicleid][Spawn][2],"veh_z"); orm_addvar_float(ormid,ServerVehicle[vehicleid][Spawn][3],"veh_a"); orm_addvar_int(ormid,ServerVehicle[vehicleid][Type],"veh_type"); orm_apply_cache(ormid,row); orm_setkey(ormid,"veh_id"); Vehicle_Create(vehicleid,INVALID_PLAYER_ID); } printf(" [Vehicle System] Loaded %d vehicles.", rows); } return 1; }
if(vehicleid == rowid == veh_type)
But i have no clue on how this works,
So im hoping someone could assist me with this.
Veh_type 0 should do nothing,
Veh_type 1 Should give a player a message and +3 wanted level
Veh_type 2 Should give a player a message +3 wanted and eject from the vehicle.
I hope someone is able to help me with this as its needed very much on the gamemode.
Thanks in advance
Yvoms