08.08.2013, 22:29
e assim:
o outro
pawn Код:
if(strcmp(cmd, "/resetallvehicles", true) == 0)
{
if(PlayerInfo[playerid][Dono] <= 4) return SendClientMessage(playerid, COLOR_RED, "Nao pds fazer este cmd");
new Float:distance = 6.0, Float:metres = distance, Float:a;
for(new i = 0; i < sizeof(DynamicCars); i++, metres += distance)
{
GetPlayerPos(playerid, DynamicCars[i][CarX], DynamicCars[i][CarY], DynamicCars[i][CarZ]);
GetPlayerFacingAngle(playerid, a);
DynamicCars[i][CarColor1] = 1;
DynamicCars[i][CarColor2] = 1;
DynamicCars[i][FactionCar] = 255;
DynamicCars[i][CarType] = 0;
DynamicCars[i][CarAngle] = a;
DynamicCars[i][CarX] += (metres * floatsin(-a, degrees));
DynamicCars[i][CarY] += (metres * floatcos(-a, degrees));
DynamicCars[i][Neon] = 0;
DynamicCars[i][cPaintjob] = 999;
ClearVehicleComponents(i);
DestroyVehicle(i);
CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
Fuel[i] = GasMax;
EngineStatus[i] = 0;
VehicleLocked[i] = 0;
SaveVehicleComponents(i);
}
SaveDynamicCars();
return 1;
}
pawn Код:
if(strcmp(cmd, "/masscarmodelrandom", true) == 0)
{
if(PlayerInfo[playerid][Dono] < 1) return SendClientMessage(playerid, COLOR_RED, "Nгo pds fazer este cmd");
for(new i = 0; i < sizeof(DynamicCars); i++)
{
new rand = random(sizeof(RandomStableModels));
DynamicCars[i][CarModel] = RandomStableModels[rand][0];
DestroyVehicle(i);
CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
Fuel[i] = GasMax;
EngineStatus[i] = 0;
VehicleLocked[i] = 0;
CarWindowStatus[i] = 1; //1 = up, 0 = down.
}
SaveDynamicCars();
return 1;
}