21.07.2013, 11:12
How can I loop through all vehicles?
If I know that I can set there engine state OnVehicleSpawn to OFF.
Thanks.
If I know that I can set there engine state OnVehicleSpawn to OFF.
Thanks.
for(new c = 0; c < MAX_VEHICLES; c++)
public OnVehicleSpawn(vehicleid)
{
for( new c = 1; c <= MAX_VEHICLES; c ++ )
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(c, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(c,0,lights,alarm,doors,bonnet,boot,objective);
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights,alarm,doors,bonnet,boot,objective);
return 1;
}
I now have this but it doesnt work:
pawn Код:
|
public OnVehicleSpawn(vehicleid)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
CMD:car(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:az;
new vehid;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, az);
vehid = CreateVehicle(402, x+1, y+5, z, az, -1, -1, 180);
PutPlayerInVehicle(playerid, vehid, 0);
return 1;
}