Jump to content

Vhe Lights


#Paper

Recommended Posts

Where's the error?

--CLIENT SIDE 
function VehLight()  
if source == GUIEditor_Button[1] then 
local R = gettok ( guiGetText(GUIEditor_Edit[1]), 1, string.byte(',') ) 
local G = gettok ( guiGetText(GUIEditor_Edit[1]), 2, string.byte(',') ) 
local B = gettok ( guiGetText(GUIEditor_Edit[1]), 3, string.byte(',') ) 
local PVeh = getPedOccupiedVehicle(getLocalPlayer()) 
local P = getLocalPlayer() 
triggerServerEvent("onVehLightsChange",getLocalPlayer(),getLocalPlayer(),R,G,B,PVeh,P) 
end 
end 
  
addEventHandler("onClientGUIClick",GUIEditor_Button[1],VehLight,false) 
--SERVER SIDE 
addEvent("onVehLightsChange", true) 
function changevhelights (R,G,B,PVeh,P) 
setVehicleHeadLightColor(PVeh,R,G,B) 
outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #0000ffYour vehicle lights has been setted!", P, 255,255,255, true) 
end 
addEventHandler("onVehLightsChange", getRootElement(), changevhelights) 

Link to comment

You should add more info, , what do you want the script to do, what doesn't work, what errors does /debugscript 3 give ...

For now, these remarks:

1) gettok returns a string

2) you're sending the local player 3 times using that server event: source, 1st arg and last arg

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...