ENUM: vcolor1[6], vcolor2[6], paintjob[6],
public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { ????? How to make it? I dont have an idea?? return 1; }
vcolor1,
vcolor2,
paintjob,
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
VehicleInfo[vehicleid][paintjob] = paintjobid;
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
VehicleInfo[vehicleid][vcolor1] = color1;
VehicleInfo[vehicleid][vcolor2] = color2;
return 1;
}
ENUM: vcolor1[6], vcolor2[6], paintjob[6],
#include <dini> - http://dracoblue.net/downloads/dini/ |
public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { VehicleInfo[vehicleid][paintjob] = paintjobid; new file[50],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(file,sizeof(file),"Server TUNE/%s.ini",name); if(!dini_Exists(file)){ dini_Create(file); dini_IntSet(file,"Paintjob",paintjobid); }else{ dini_IntSet(file,"Paintjob",paintjobid); } return 1; } |
OnVehicleRespray(playerid, vehicleid, color1, color2) { VehicleInfo[vehicleid][vcolor1] = color1; VehicleInfo[vehicleid][vcolor2] = color2; new file[50],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(file,sizeof(file),"Server/Tune/%s.ini",name); if(!dini_Exists(file)){ dini_Create(file); dini_IntSet(file,"vcolor1",color1); dini_IntSet(file,"vcolor2",color2); }else{ dini_IntSet(file,"vcolor1",color1); dini_IntSet(file,"vcolor2",color2); } return 1; } |
enum e_Vehicles
{
VehicleID,
Color1,
Color2,
Paintjob
};
new Vehicles[5][e_Vehicles];
// 5 vehicles: bounds 0-4
// OnGameModeInit/OnFilterScriptInit:
for (new i; i != sizeof (Vehicles); ++i)
{
Vehicles[i][VehicleID] = INVALID_VEHICLE_ID;
Vehicles[i][Color1] = Vehicles[i][Color1] = -1;
Vehicles[i][Paintjob] = 3;
}
// OnVehiclePaintjob
for (new i; i != sizeof (Vehicles); ++i)
{
if (vehicleid == Vehicles[i][VehicleID])
{
Vehicles[i][Paintjob] = paintjobid;
}
}
// OnVehicleRespray
for (new i; i != sizeof (Vehicles); ++i)
{
if (vehicleid == Vehicles[i][VehicleID])
{
Vehicles[i][Color1] = color1;
Vehicles[i][Color2] = color2;
}
}
// When creating a vehicle check if the vehicle ID is not INVALID_VEHICLE_ID and:
Vehicles[index_here][VehicleID] = CreateVehicle(...);
// when destroying a vehicle (same as above):
DestroyVehicle(Vehicles[index_here][VehicleID]);
Vehicles[index_here][VehicleID] = INVALID_VEHICLE_ID;
// don't forget to reset it
enum pInfo { //OTHER STUFF ... Model[6], vcolor1[6], vcolor2[6], comp1[6], comp2[6], comp3[6], comp4[6], comp5[6], comp6[6], comp7[6], comp8[6], comp9[6], paintjob[6] //OTHER STUFF ... } new PlayerInfo[MAX_PLAYERS][pInfo];