GrubaS Posted March 4, 2015 Posted March 4, 2015 Hello, How i can make sirens like on this ScreenShot?
Castillo Posted March 4, 2015 Posted March 4, 2015 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
GrubaS Posted March 4, 2015 Author Posted March 4, 2015 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.
Ab-47 Posted March 4, 2015 Posted March 4, 2015 Use: isObjectInACLGroup then the function to attach extra2
GrubaS Posted March 5, 2015 Author Posted March 5, 2015 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)
Ab-47 Posted March 5, 2015 Posted March 5, 2015 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.
GrubaS Posted March 8, 2015 Author Posted March 8, 2015 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now