Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] [SOLVED] How make function to turn on the vehicle lights blinks like siren alarm ?

 
  • 0 Vote(s) - 0 Average
Pawn [SOLVED] How make function to turn on the vehicle lights blinks like siren alarm ?
PutuSuhartawan
Offline

Burgershot Member
Posts: 120
Threads: 52
Joined: Nov 2020
Reputation: 1
Location: Indonesia
#1
2021-05-04, 04:38 AM (This post was last modified: 2021-05-20, 03:11 AM by PutuSuhartawan.)
SOLUTION:
Code:
public UpdateServer(playerid)
{
      new vehicleid = GetPVarInt(playerid,"BlinkVehID"), panels, doors, lights, tires;
      if(g_vehicle_params[vehicleid][V_BLINK] == true)
      {
            GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
           
            if(g_vehicle_params[vehicleid][V_BLINKING] == 1)
            {
              UpdateVehicleDamageStatus(vehicleid, 0, doors, 1, tires);
              g_vehicle_params[vehicleid][V_BLINKING] = 69;
            }
            else if(g_vehicle_params[vehicleid][V_BLINKING] == 69)
            {
              UpdateVehicleDamageStatus(vehicleid, 0, doors, 69, tires);
              g_vehicle_params[vehicleid][V_BLINKING] = 0;
            }
            else if(g_vehicle_params[vehicleid][V_BLINKING] == 0)
            {
              UpdateVehicleDamageStatus(vehicleid, 0, doors, 1, tires);
              g_vehicle_params[vehicleid][V_BLINKING] = 4;
            }
            else
            {
              UpdateVehicleDamageStatus(vehicleid, 0, doors, 4, tires);
              g_vehicle_params[vehicleid][V_BLINKING] = 1;
            }
       

      }

}
Source Pawn : Blinking Lights.pwn
Tutorial : Video
Problem:
function to turn on the vehicle lights so that it blinks like a siren
someone intelligent has asked. but I only know the parameter toggle lights and also neon. how do you turn on the flashing lights without fluorescent?
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#2
2021-05-07, 04:41 PM
I'm guessing you want to set a timer that switches the lights on and off; https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Enabling the alarm would do the same thing but it would also trigger the alarm (horn) sound so you would want to avoid that.
PutuSuhartawan
Offline

Burgershot Member
Posts: 120
Threads: 52
Joined: Nov 2020
Reputation: 1
Location: Indonesia
#3
2021-05-07, 06:34 PM
(2021-05-07, 04:41 PM)Kwarde Wrote: I'm guessing you want to set a timer that switches the lights on and off; https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Enabling the alarm would do the same thing but it would also trigger the alarm (horn) sound so you would want to avoid that.

sorry sir, I mean here the lights change right and left. not the two of them blinking at the same time sir. so how do you get the right light blinking with the left light?
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#4
2021-05-07, 08:11 PM
https://sampwiki.blast.hk/wiki/LightStates

Update lights damage while the lights are enabled (via timer)
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
PutuSuhartawan
Offline

Burgershot Member
Posts: 120
Threads: 52
Joined: Nov 2020
Reputation: 1
Location: Indonesia
#5
2021-05-08, 12:53 AM (This post was last modified: 2021-05-13, 02:43 PM by PutuSuhartawan.)
(2021-05-07, 08:11 PM)Pinch Wrote: https://sampwiki.blast.hk/wiki/LightStates

Update lights damage while the lights are enabled (via timer)

Sir sorry, i need help if 
 i will use like this

4: (0000 0100)

    o-x
    | |
    o-o



what is the parameter soon in this function sir?

Solution:

new Panels, Doors, Lights, Tires;
GetVehicleDamageStatus(vehicleid, Panels, Doors, Lights, Tires);
UpdateVehicleDamageStatus(vehicleid, Panels, Doors, (4), Tires);
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode