08.12.2010, 21:33
Try this:
Edit: Oh, I see you have the same problem for engines. Try this one for the engines:
pawn Код:
if(strcmp(cmdtext, "/lights",true) == 0){
if(IsPlayerInAnyVehicle(playerid)
if(Lights[playerid] == 0){
Lights[playerid] = 1;
new vid123 = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid123,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid123,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
return 1;
}
if(Lights[playerid] == 1){
Lights[playerid] = 0;
GetVehicleParamsEx(vid123,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid123,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
return 1;
}
}
pawn Код:
if(strcmp(cmdtext, "/engine",true) == 0) {
if(IsPlayerInAnyVehicle(playerid) {
if(Engine[playerid] == 0){
Engine[playerid] =1;
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
if(Engine[playerid] == 1) {
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Engine[playerid] =0;
return 1;
}
}