SA-MP Forums Archive
Lights Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Lights Help (/showthread.php?tid=284051)



Lights Help - Trucker[UK] - 17.09.2011

Hello

Can anyone help me

I am trying to get my lights to go to the back of my trailer when i am in my truck when i have my lights on anyway i can get it as just now they don't come on my trailer

Help please

Thanks


Re: Lights Help - =WoR=Varth - 17.09.2011

You mean when you attach a vehicle in your vehicle, the rear lights of you vehicle will turned off then the other vehicle's rear lights turned on? No you can't do that. Except you turned both of them.

EDIT: Just crossed in my mind. You can do UpdateVehicleDamageStatus on the lights


Re: Lights Help - Trucker[UK] - 17.09.2011

i want it when u attach a trailer to ur vehicle the rear lights of that vehicle and ur lights all come on and stay on till u turn them off


Re: Lights Help - =WoR=Varth - 17.09.2011

You can set the light params for the attached vehicle.
pawn Код:
new trash,lights;
GetVehicleParamsEx(yourvehicleid,trash,lights,trash,trash,trash,trash,trash);
if(lights) SetVehicleParamsEx(theattachvehicle,-1,lights,-1,-1,-1,-1,-1);



Re: Lights Help - Trucker[UK] - 17.09.2011

were will i add this too


Re: Lights Help - =WoR=Varth - 17.09.2011

What do you mean?


Re: Lights Help - FrostDoggy - 17.09.2011

He means something like

OnGameModeInit , I think he ask where to put that functions.


Respuesta: Lights Help - OPremium - 17.09.2011

pawn Код:
CMD:trailerlightson(playerid, params[])
{
    if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not driving a vehicle!");
    if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: No trailer attached!");
    SetVehicleParamsEx(GetVehicleTrailer(GetPlayerVehicleID(playerid)), 1, 1, -1, -1, -1, -1, -1);
    SendClientMessage(playerid, 0xFFFF00FF, "Trailer lights turned {00ff00}on{ffff00}!");
    return 1;
}

CMD:trailerlightsoff(playerid, params[])
{
    if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not driving a vehicle!");
    if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: No trailer attached!");
    SetVehicleParamsEx(GetVehicleTrailer(GetPlayerVehicleID(playerid)), 0, 0, -1, -1, -1, -1, -1);
    SendClientMessage(playerid, 0xFFFF00FF, "Trailer lights turned {ff0000}off{ffff00}!");
    return 1;
}
Something like that?


Re: Lights Help - Trucker[UK] - 17.09.2011

were do i add this too


Re: Respuesta: Lights Help - Trucker[UK] - 24.09.2011

Quote:
Originally Posted by OPremium
Посмотреть сообщение
pawn Код:
CMD:trailerlightson(playerid, params[])
{
    if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not driving a vehicle!");
    if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: No trailer attached!");
    SetVehicleParamsEx(GetVehicleTrailer(GetPlayerVehicleID(playerid)), 1, 1, -1, -1, -1, -1, -1);
    SendClientMessage(playerid, 0xFFFF00FF, "Trailer lights turned {00ff00}on{ffff00}!");
    return 1;
}

CMD:trailerlightsoff(playerid, params[])
{
    if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not driving a vehicle!");
    if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: No trailer attached!");
    SetVehicleParamsEx(GetVehicleTrailer(GetPlayerVehicleID(playerid)), 0, 0, -1, -1, -1, -1, -1);
    SendClientMessage(playerid, 0xFFFF00FF, "Trailer lights turned {ff0000}off{ffff00}!");
    return 1;
}
Something like that?
like that but i want it when u attach a trailer the trailer lights automatically come on