MAB Posted August 1, 2015 Share Posted August 1, 2015 how to make settings in this script.. the settings should be #MarkerSize.. should change the marker size.. i couldn't understand anything in the wiki...the marker is at line 8 --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local solt = getPedWeaponSlot ( source ) if ( solt == 0 or solt == 1 or solt == 8 or solt == 9 or solt == 10 or solt == 11 or solt == 12 or solt == 7 ) then return end -- if his weapon isn't a gun then don't do the function if isElement ( hitElement ) then -- check if there is a hitElement ( something he is hitting ) if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player or a vehicle then don't make the marker , cuz no need for it end marker = createMarker ( hitX, hitY, hitZ, "corona", -0.1, 255, 255, 255, 255 ) -- when the player shoot we create a white marker in the place that the bullet hit and make it visible for the player who is shooting only. if solt == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if solt == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if solt == 4 then -- if he is using a sub machine gun then setMarkerColor ( marker, 255, 255, 0, 255 ) -- set the marker colour as yellow end if solt == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if solt == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, markers ) -- show him the markers Link to comment
GTX Posted August 1, 2015 Share Posted August 1, 2015 What do you mean? This? local MarkerSize = -0.1 --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local solt = getPedWeaponSlot ( source ) if ( solt == 0 or solt == 1 or solt == 8 or solt == 9 or solt == 10 or solt == 11 or solt == 12 or solt == 7 ) then return end -- if his weapon isn't a gun then don't do the function if isElement ( hitElement ) then -- check if there is a hitElement ( something he is hitting ) if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player or a vehicle then don't make the marker , cuz no need for it end marker = createMarker ( hitX, hitY, hitZ, "corona", MarkerSize, 255, 255, 255, 255 ) -- when the player shoot we create a white marker in the place that the bullet hit and make it visible for the player who is shooting only. if solt == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if solt == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if solt == 4 then -- if he is using a sub machine gun then setMarkerColor ( marker, 255, 255, 0, 255 ) -- set the marker colour as yellow end if solt == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if solt == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, markers ) -- show him the markers Or do you mean settings from meta? get Link to comment
MAB Posted August 2, 2015 Author Share Posted August 2, 2015 meta , GTX.. to edit the size from the admin panel , resources , settings Link to comment
GTX Posted August 2, 2015 Share Posted August 2, 2015 Add this to your meta: <settings> <setting name="*markerSize" value="markerSize" friendlyname="" group="" accept="" examples="" desc="" /> </settings> Then you have to get settings from server side: local markerSize = get"markerSize" triggerClientEvent("receiveSettings", root, markerSize) Client side would look like: local MarkerSize = -0.1 addEvent("receiveSettings", true) addEventHandler("receiveSettings", root, function(markerSize) MarkerSize = markerSize end ) --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local solt = getPedWeaponSlot ( source ) if ( solt == 0 or solt == 1 or solt == 8 or solt == 9 or solt == 10 or solt == 11 or solt == 12 or solt == 7 ) then return end -- if his weapon isn't a gun then don't do the function if isElement ( hitElement ) then -- check if there is a hitElement ( something he is hitting ) if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player or a vehicle then don't make the marker , cuz no need for it end marker = createMarker ( hitX, hitY, hitZ, "corona", MarkerSize, 255, 255, 255, 255 ) -- when the player shoot we create a white marker in the place that the bullet hit and make it visible for the player who is shooting only. if solt == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if solt == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if solt == 4 then -- if he is using a sub machine gun then setMarkerColor ( marker, 255, 255, 0, 255 ) -- set the marker colour as yellow end if solt == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if solt == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, markers ) -- show him the markers Link to comment
MAB Posted August 2, 2015 Author Share Posted August 2, 2015 mmm.. not working... debugscript : ERROR : Server triggered clientside event receiveSettings, but event is not added clientside Link to comment
GTX Posted August 2, 2015 Share Posted August 2, 2015 It's just an example. Add onResourceStart. Link to comment
MAB Posted August 2, 2015 Author Share Posted August 2, 2015 Oh.. Ok thank you very much you r a great helper and scripter..i wish that there r more people like u Link to comment
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