-
Posts
313 -
Joined
-
Last visited
Everything posted by MAB
-
mm... not working... i see the setting in the settings list and i can change the value but nothing happens to the marker size even after restarting the resource.. also there is a debugscript message saying : ERROR : Server triggered clientside event receiveSettings, but event is not added clientside . meta .. "Michael" type="script" name="" description="" /> client .. local MarkerSize = -0.1 function addevent () addEvent("receiveSettings", true) end addEventHandler( "onClientResourceStart", getRootElement( ), addevent ) addEventHandler("receiveSettings", root, function(markerSize) MarkerSize = markerSize end ) --that is all u need.... Server... local markerSize = get("markerSize") triggerClientEvent("receiveSettings", root, markerSize)
-
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
-
what is the diffrance between onClientRender and onClientPreRender ? if i made a anim window using dxCreateAnimWindow then i made a rectangle and text so if want the rectangle and the text to move with the window.. should i use setElementParent or something like that? for a dx login panel do i use. . addEventHandler ("onClientResourceStart",resourceRoot,function() addEventHandler("onClientRender",root,functionName) ?? about the arguments ()... if the () is like that createVehicle(411, x, y,z )... would it effect anything?
-
what is the diffrance between onClientRender and onClientPreRender ? if i made a anim window using dxCreateAnimWindow then i made a rectangle and text so if want the rectangle and the text to move with the window.. should i use setElementParent or something like that? for a dx login panel do i use. . addEventHandler ("onClientResourceStart",resourceRoot,function() addEventHandler("onClientRender",root,functionName) ?? about the arguments ()... if the () is like that createVehicle(411, x, y,z )... would it effect anything?
-
nvm done it with isElement(hitElement)
-
thx working now but there is a debug error message saying .. "23: bad argument @ 'getElementType' expected element at argument 1 got nil
-
what is the problem i see no marker and there is no messages at debugscript .. i didn't test until i finished typing the codes i can't find the problem --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if ( getPedWeaponSlot ( source ) == 0 or 1 or 8 or 9 or 10 or 11 or 12 ) then return end -- if his weapon isn't a gun then don't do the function if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player then don't make the marker , cuz no need for it 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 getPedWeaponSlot ( source ) == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if getPedWeaponSlot ( source ) == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if getPedWeaponSlot ( source ) == 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 getPedWeaponSlot ( source ) == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if getPedWeaponSlot ( source ) == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if getPedWeaponSlot ( source ) == 7 then setMarkerColor ( marker, 0, 0, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", root, markers )
-
not working... no debug messages.. no explosion or effect happens... showCursor works but idk about the events function start() showCursor(true) addEventHandler("onClientClick",localPlayer,explosion) end addCommandHandler("ilovetoburn",start) function explosion (button,state,a,b,x,y,z) if (button == "left" and state == "down") then createExplosion (x,y,z,1,true,-2,true) createEffect ("teargas",x,y,z) end end function stop() showCursor(false) removeEventHandler("onClientClick",localPlayer,explosion) end addCommandHandler("ihatetoburn",stop)
-
attempt to call global 'createEffect' function start(player) if ( hasObjectPermissionTo ( player, "function.kickPlayer", false ) ) then showCursor(player,true,true) addEventHandler("onPlayerClick",player,explosion) end end addCommandHandler("ilovetoburn",start) function explosion (button,state,element,x,y,z) if (button == "left" and state == "down") then createExplosion (x,y,z,1) createEffect ("teargas",x,y,z) end end function stop(player) if ( hasObjectPermissionTo ( player, "function.kickPlayer", false ) ) then showCursor(player,false,false) removeEventHandler("onPlayerClick",player,explosion) end end addCommandHandler("ihatetoburn",stop)
-
You've to check if the player who hitting marker is a localPlayer. Example: function MarkerHit(hitPlayer,matchingDimension) if( hitPlayer == localPlayer ) then guiSetVisible (windowname,true) showCursor (true) end end addEventHandler ("onClientMarkerHit",Marker,MarkerHit) What marker?!
-
explosion doesn't get created... i want to create explosion in the place that the player click on... function onClientPlayerWeaponFireFunc(player) showCursor(player,true,false) addEventHandler("onPlayerClick",player,explosion) end addCommandHandler("ilovetoburn",onClientPlayerWeaponFireFunc) function explosion (button,state,a,b,x,y,z) if (button == "left" and state == "down") then createExplosion (x,y,z,1) showCursor(source,false,false) end end
-
help the button is not working... sx,sy = guiGetScreenSize() x,y = (sx/1280),(sy/768) function edit () color2 = tocolor(255,255,255,255) dxDrawText("Close", x*756, y*522, x*870, y*552, color2, 1.30, "pricedown", "left", "top", false, false, false, false, false) addEventHandler( "onClientRender", root, edit ) function join ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( absoluteX == x*870 and absoluteY == y*552 ) then if ( button == "left" and state == "up" ) then showCursor(false) removeEventHandler("onClientRender", root, edit) end end end addEventHandler ( "onClientClick", root, join )