new vehicle[4];
enum vehicleVars{
vUndercover,
}
new vehicleInfo[MAX_VEHICLES][vehicleVars];
if(vehicleInfo[vehicleid][vUndercover] == 1){
...
}
new Undercover[MAX_VEHICLES]; //variable for making vehicles undercover //..... new veh1 = CreateVehicle(...); // Create a vehicle Undercover[veh1]=1; // you can use 1-true and 0-false to control it,here you make that vehicle undercover
please post more information what should be a "undercover car".. it doesnґt make sense..
|
if(GetPlayerVehicleID(vehicleid) != vehicle[0] || vehicle[1] || vehicle[2] || vehicle[3])
What am I trying to do is to conver this:
pawn Код:
Thanks for help. |
The code I wrote above can hold up to 2000 vehicles (SA-MP does not support more).
|
vehicle[0] = AddStaticVehicle(477,1601.6586,-1688.0300,5.6453,90.2666,0,0); // ZR350 1 - Black
vehicle[1] = AddStaticVehicle(477,1601.6870,-1683.8280,5.6452,90.6299,0,0); // ZR350 2 - Black
vehicle[2] = AddStaticVehicle(560,1585.2329,-1667.4893,5.5978,270.7180,0,0); // Sultan 1 - Black
vehicle[3] = AddStaticVehicle(560,1585.2502,-1671.7484,5.5982,269.6357,0,0); // Sultan 2 - Black
stock IsUnderCoverCar(vehicleid)
{
if(vehicleid == vehicle[0] || vehicleid == vehicle[1] || vehicleid == vehicle[2] || vehicleid == vehicle[3])
{
return 1;
}
return 0;
}
#define MAX_VEHICLES 2000
enum vehicleVars{
vModel,
vX,
vY,
vZ,
vR,
vColor1,
vColor2,
vUndercover,
}
new vehicleInfo[MAX_VEHICLES][vehicleVars];
// ZR350 1 - Black
vehicleInfo[0][vModel] = 477;
vehicleInfo[0][vX] = 1601.6586;
vehicleInfo[0][vY] = -1688.0300;
vehicleInfo[0][vZ] = 5.6453;
vehicleInfo[0][vR] = 90.2666;
vehicleInfo[0][vColor1] = 0;
vehicleInfo[0][vColor2] = 0;
// Sultan 1 - Black
vehicleInfo[1][vModel] = 560;
vehicleInfo[1][vX] = 1585.2329;
vehicleInfo[1][vY] = -1667.4893;
vehicleInfo[1][vZ] = 5.5978;
vehicleInfo[1][vR] = 270.7180;
vehicleInfo[1][vColor1] = 0;
vehicleInfo[1][vColor2] = 0;
// Sultan 2 - Black
vehicleInfo[2][vModel] = 560;
vehicleInfo[2][vX] = 1585.2502;
vehicleInfo[2][vY] = -1671.7484;
vehicleInfo[2][vZ] = 5.5982;
vehicleInfo[2][vR] = 269.6357;
vehicleInfo[2][vColor1] = 0;
vehicleInfo[2][vColor2] = 0;
for(new vehicle = 0; vehicle < MAX_VEHICLES; vehicle++){
CreateVehicle(vehicleInfo[vehicle][vModel], vehicleInfo[vehicle][vX], vehicleInfo[vehicle][vY], vehicleInfo[vehicle][vZ], vehicleInfo[vehicle][vR], vehicleInfo[vehicle][vColor1], vehicleInfo[vehicle][vColor2], 0);
}
stock IsUnderCoverCar(vehicleid)
{
if(vehicleInfo[vehicleid][vUndercover] == 1){
}
return 1;
}
if(strcmp(cmd, "/siren", true) == 0)
{
new vehicleid = GetVehicleModel(vehicleid);
if(IsPlayerConnected(playerid))
{
if(GetPlayerVehicleID(vehicleid) != IsUnderCoverCar(vehicleid))
{
//
}
new x_nr[256]; // number
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) // if number is not entered player will get error message
{
SendClientMessage(playerid,0xFF0000AA,"Choose type for siren: 1 - Dashboard, 2 - Roof!"); // error message
return 1;
}
else if(strcmp(x_nr,"1",true) == 0) // if they will enter /siren 1 object will be placed inside of car
{
//
}
else if(strcmp(x_nr,"2",true) == 0) // if they will enter /siren 2 object will be on roof
{
//
}
}
}
return 1;
}