Jump to content

[HELP] Sirens


GrubaS

Recommended Posts

Hello , I've got a dff file with 3 different objects in chassis_dummy ,

extra1 - 'driving school' plate placed on the cheetah

extra2 - sirens placed on the cheetah also

extra3 - normal cheetah

Now the question is how can i make extra2 only for Admins , so if the player was in the group 'Admin' then he will have siren on his cheetah.

Any help would be greatly appreciated.

Link to comment

Hello Guys,

I want make this script for Cheetah (id=419) and only for admins,

How do it? :|

addEventHandler("onVehicleEnter",root,function(player,seat) 
    local accountname = getAccountName (getPlayerAccount(player)) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) )  then 
   if(player)and(seat==0)then 
      addVehicleSirens(source,1,2) 
      setVehicleSirens(source,1, 0.4, -0.2, 0.6, 0, 0, 255, 255, 255) 
      addVehicleSirens(source,2,2) 
      setVehicleSirens(source,2, -0.4, -0.2, 0.6, 255, 0, 0, 255, 255) 
   end 
   end 
end) 
addEventHandler("onVehicleExit",root,function(player,seat) 
   if(player)and(seat==0)then 
      removeVehicleSirens(source) 
   end 
end) 

Link to comment

After

if(player)and(seat==0)then 

follow Solidsnake's suggestion:

It's just a object attached to the car.

You need to get the sirens object, then replace it with a object.

And then to attach it:

createObject 
attachElements 

Use those functions to create the object (the siren object you want) and attach the object to the vehicle.

Link to comment

I want make, if points is 100 / 300 / 400 then on my car will be "School Driver" but when points will be more than 1000 then it will be car without "school driver" :)

ps. sry for english ;x

function setMyVehiclesVariant() 
    if (tonumber(getElementData(source,"points")) = 1000) then 
  
        local wasSet = setVehicleVariant(source, 0, 255) 
  else 
    local wasSet = setVehicleVariant(source, 255, 255) 
end 
end 
addEventHandler ( "onVehicleEnter", root,setMyVehiclesVariant) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...