-
Posts
218 -
Joined
-
Last visited
Everything posted by Deep thinker
-
i tried to make the team with the meta but i failed can anyone show me an example expect the wiki's one i tried it and failed
-
i want to set the taser script for the police team --client local cFunc = {} local cSetting = {} cSetting["shots"] = {} cSetting["shot_calcs"] = {} local last_shot = 1 -- FUNCTIONS -- cFunc["render_shots"] = function() for index, tbl in pairs(cSetting["shots"]) do dxDraw:OedLine3D(tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6], tocolor(0, 255, 0)) end end cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2) table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2}) -- SHOT CALCULATING local lastx, lasty, lastz = x1, y1, z1 local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) cSetting["shot_calcs"][last_shot] = {} for i = 1, dis, 0.5 do -- cSetting["shot_calcs"][i] = nx, ny, nz -- cSetting["shot_calcs"][last_shot][i] = end last_shot = last_shot+1 end cFunc["shot_weapon"] = function(hitX, hitY, hitZ, x, y, z) playSound3D("data/Fire.wav", x, y, z) local s = playSound3D("data/Fire.wav", hitX, hitY, hitZ) setSoundMaxDistance(s, 50) for i = 1, 5, 1 do fxAddPunchImpact(hitX, hitY, hitZ, 0, 0, 0) fxAddSparks(hitX, hitY, hitZ, 0, 0, 0, 8, 1, 0, 0, 0, true, 3, 1) end cFunc["draw_shot"](x, y, z, hitX, hitY, hitZ) fxAddPunchImpact(x, y, z, 0, 0, -3) end cFunc["wait_shot"] = function() toggleControl("fire", false) setTimer(function() toggleControl("fire", true) end, 350, 1) end cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ) if(wp == 23) then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) if(source == localPlayer) then cFunc["wait_shot"]() end end end dxDraw:OedLine3D = function(x1, y1, z1, x2, y2, z2, color) local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) local lastx, lasty, lastz = x1, y1, z1 --for i = 1, dis, 3 do -- dxDrawLine3D(x1, y1, z1, x2, y2, z2) --end end cFunc["anim_check"] = function(_, wep, bodypart) if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 10000, false, true, false) elseif(wep == 23) and (bodypart == 8) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 10000, false, true, false) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 10000, false, true, false) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) end end -- EVENT HANDLER -- addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"]) and if it any anther team then he can't use the taser function i will show you how did i do it: I also wanted to create teams and i want the link of it from wiki
-
now i started to make a script on my own with the functions you have taught me. thank you again
-
thank you very much,and i am sorry for annoying you
-
it worked but i wanted to destroy the vehicle on the marker hit and if he left the vehicle before reaching also destroing the other elements ,marker,blip and give him 10000$ check this local newVehicle = { } local myBlip = { } local marker = { } addEvent('MyEvent',true) addEventHandler('MyEvent',root, function ( ) if newVehicle [ source ] and isElement ( newVehicle [ source ] ) then return false end newVehicle [ source ] = createVehicle ( 413,1603.34717,-1459.95898,13.68424 ) warpPedIntoVehicle ( source,newVehicle [ source ] ) myBlip [ source ] = createBlip( 1019.93677,2373.41040,10.93885,51,2,255,0,0,255,0 ) setElementVisibleTo( myBlip [ source ],root,false ) setElementVisibleTo( myBlip [ source ],source,true ) marker [ source ] = createMarker ( 1019.93677,2373.41040,9.93885,'cylinder',2,0,255,0,255,source ) end ) function destory local checkedPlayer = getPlayerFromName ( checkedPlayerName ) if ( checkedPlayer ) then if isPedInVehicle ( checkedPlayer ) then getVehicleID ( theVehicle ) else destroyElement( newVehicle [ source ] ) outPutChatBox("You have been suspended for leaving the Pony"255,0,0) end addEventHandler("onPlayerVehicleExit", getRootElement(),destroy) addEventHandler("onMarkerHit",root, function() if isElement(newVehicle [ source ]) then destroyElement(newVehicle [ source ]) if isElement(myBlip [ source ]) then destroyElement(myBlip [ source ]) if isElement(marker [ source ]) then destroyElement(marker [ source ]) givePlayerMoney ( thePlayer, 10000 ) end ) after adding this i can't create the vehicle or do anything from the new functions i know that i have asked you a lot about that script but this is my first script of all i have read wiki tons of times ,you have taught me new things i have never knew but thanks for what you have done ,also this is the last part of the script ,i swear i tried to script it on my own ,but please forgive me because i asked a lot
-
i did like this but i want to warp the player in the vehicle that i have created can you add to this part -- server side addEvent("MyEvent",true) addEventHandler("MyEvent",root, function ( ) local newVehicle = createVehicle ( 413, 1603.34717, -1459.95898, 13.68424, 0, 0, rotZ ) warpPedIntoVehicle ( localPlayer, newVehicle ) local myBlip = createBlip( 1019.93677, 2373.41040, 10.93885, 51, 0, 0, 0, 255, myPlayer ) local marker = createMarker ( 1019.93677, 2373.41040, 10.93885,"cylinder",2,0,255,0,255 ) end --client side local marker = createMarker ( 1615.48865,-1506.98303,13.20866,"cylinder",2,255,0,0,255 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(0.3663,0.2905,0.2821,0.4502,"Drug Delivery Request",true) guiSetAlpha(GUIEditor_Window[1],1) guiSetVisible ( GUIEditor_Window[1],false ) GUIEditor_Button[1] = guiCreateButton(176,338,96,26,"Accept",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(41,338,96,26,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Image[1] = guiCreateStaticImage(0.3811,0.3866,0.2257,0.1944,"images/target.png",true) GUIEditor_Memo[1] = guiCreateMemo(15,24,294,45,"Follow the blue line on this map or the car blip in radar you will be rewarded with 10000$ .",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function ToggleDDMenu ( hit ) if ( hit and hit == localPlayer ) then if eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Window[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) elseif eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Image[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Image[1],false ) showCursor ( false ) end end end addEventHandler("onClientMarkerHit",marker,ToggleDDMenu) addEventHandler("onClientMarkerLeave",marker,ToggleDDMenu) addEventHandler ('onClientGUIClick',GUIEditor_Button[2], function ( ) guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) end,false ) function ToggleDDMenu ( hit ) if ( hit and hit == localPlayer ) then if eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Window[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) end end end addEventHandler("onClientMarkerHit",marker,ToggleDDMenu) addEventHandler("onClientMarkerLeave",marker,ToggleDDMenu) addEventHandler ('onClientGUIClick',GUIEditor_Button[2], function ( ) guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) end,false ) addEventHandler ('onClientGUIClick',GUIEditor_Button[1], function ( ) guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) triggerServerEvent ("MyEvent",localPlayer) end,false ) when i press accept nothing happens and it just hides the GUI, wait i have fixed the accept button bug expect warping into the vehicle
-
thank you i will be working on it but i want to know how to tigger it ,can you tell me?
-
it worked perfectly ,thank you but now i wanna create a vehicle and warp the player into this vehicle and when he is in a vehicle he see a blip and if he left the vehicle ,the vehicle get destroied.
-
I did i have created the function under the GUI creation like this : local marker = createMarker ( 1615.48865,-1506.98303,12.20866,"cylinder",2,255,0,0,255 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(0.5399,0.6794,0.4063,0.456,"Drug Delivery System ",true) -- Add this under create window function : guiSetVisible ( GUIEditor_Window[1],false ) GUIEditor_Button[1] = guiCreateButton(317,345,68,40,"Accept",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(245,346,68,39,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(18,33,438,102,"Deliver the Car to the blip on the radar in LV .\nIf there is any bugs report it to the owners.",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function ToggleDDMenu ( hit ) if ( hit and hit == localPlayer ) then if eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Window[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) end end end addEventHandler("onClientMarkerHit",marker,ToggleDDMenu) addEventHandler("onClientMarkerLeave",marker,ToggleDDMenu) function buttons elseif source == 'onClientGUIClick' then if (source == GUIEditor_Button[2]) then guiSetVisible ( GUIEditor_Window[1],false ) end please answer as soon as possible
-
every time the script be like this i can see the spawner but i can't control the buttons local marker = createMarker ( 1615.48865,-1506.98303,13.20866,"cylinder",2,255,0,0,255 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(0.5399,0.6794,0.4063,0.456,"Drug Delivery System ",true) -- Add this under create window function : guiSetVisible ( GUIEditor_Window[1],false ) GUIEditor_Button[1] = guiCreateButton(317,345,68,40,"Accept",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(245,346,68,39,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(18,33,438,102,"Deliver the Car to the blip on the radar in LV .\nIf there is any bugs report it to the owners.",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function ToggleDDMenu ( hit ) if ( hit and hit == localPlayer ) then if eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Window[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) end end end addEventHandler("onClientMarkerHit",marker,ToggleDDMenu) addEventHandler("onClientMarkerLeave",marker,ToggleDDMenu) so after adding this part i can't see the spawner and it's fully on the client side local marker = createMarker ( 1615.48865,-1506.98303,13.20866,"cylinder",2,255,0,0,255 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(0.5399,0.6794,0.4063,0.456,"Drug Delivery System ",true) -- Add this under create window function : guiSetVisible ( GUIEditor_Window[1],false ) GUIEditor_Button[1] = guiCreateButton(317,345,68,40,"Accept",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(245,346,68,39,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(18,33,438,102,"Deliver the Car to the blip on the radar in LV .\nIf there is any bugs report it to the owners.",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function ToggleDDMenu ( hit ) if ( hit and hit == localPlayer ) then if eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Window[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) elseif source == 'onClientGUIClick' then if (source == GUIEditor_Button[2]) then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) end end end addEventHandler("onClientMarkerHit",marker,ToggleDDMenu) addEventHandler("onClientMarkerLeave",marker,ToggleDDMenu) addEventHandler("onClientGUIClick",marker,ToggleDDMenu)
-
NOTHING new ,i screwed up :3 i couldn't fix dis part
-
it doesn't work but it's okay i need help with the other script i tried to set the cancel Button to set the GUI vis but it doesn't work ,anyone check it please and i need help with the anther part if he pressed "accept" he get warped into a vehicle and create a blip (1022.49725, 2372.31763, 10.82031) also marker over here and when he reaches the anther marker he gets 10000$ and destroy his vehicle and please make the vehicle pony,and if he tried to leave the vehicle before reaching the anther marker then the vehicle get destroied and i will work on it ,after 10 i will tell you what have i done and here is the script local marker = createMarker ( 1615.48865,-1506.98303,12.20866,"cylinder",2,255,0,0,255 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(0.5399,0.6794,0.4063,0.456,"Drug Delivery System ",true) -- Add this under create window function : guiSetVisible ( GUIEditor_Window[1],false ) GUIEditor_Button[1] = guiCreateButton(317,345,68,40,"Accept",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(245,346,68,39,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(18,33,438,102,"Deliver the Car to the blip on the radar in LV .\nIf there is any bugs report it to the owners.",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function ToggleDDMenu ( hit ) if ( hit and hit == localPlayer ) then if eventName == 'onClientMarkerHit' then guiSetVisible ( GUIEditor_Window[1],true ) showCursor ( true ) elseif eventName == 'onClientMarkerLeave' then guiSetVisible ( GUIEditor_Window[1],false ) showCursor ( false ) elseif source == GUIEditor_Button[2] then guiSetVisible( GUIEditor_Window[1], false) showCursor(false) end end end addEventHandler("onClientMarkerHit",marker,ToggleDDMenu) addEventHandler("onClientMarkerLeave",marker,ToggleDDMenu)
-
canwarp = 1 local antiwarping = { {x = 200, y = 200, z = 20, width = 100, depth = 100, height = 15}, -- antiwarp } function antiwarping if antiwarping and #antiwarping ~= 0 then for _,v in ipairs (greenzones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local c = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height) local rarea = createRadarArea (v.x, v.y, v.width, v.depth, 0, 0, 255, 255) setElementParent (rarea, c) end end function warp(thePlayer, ...) for i,colshape in ipairs(colshapes) do check = isElementWithinColShape(thePlayer, colshape) if check then canwarp = 0 break end end if canwarp == 1 then warpwarpwarpwarpfunction... else outputChatBox("can't warp here") end canwarp = 1 end i wanted to disable warping in colshape or even warping someone inside this colshape and anther thing out of this how can i create a vehicle on the first script and warp the ped in to this vehicle and draw a blip on warping and after hitting the anther marker destroy the blip and the marker.
-
Worked Perfectly Thank you Very much ,I wanted to ask about anther script
-
wait i saw the marker but there is a bug ,even if i haven't hit the marker i can see the GUI also i want to the mouse to have the full options with the GUI after scripting the buttons i see the mouse only hitting the marker
-
i tried it still can't see the marker ,what about making it in the server side but how come to add the GUI into the Server side?
-
actually i have a tiny scripting experience so i didn't know about this onClientMarkerHit also i have done what you all said ,but i don't even know wtf is this debug script :3 also sometimes i don't know which functions/events to use in the client and server side
-
Hello I have made a script but it's not done yet so i need help with the markers they aren't getting viewed in game i think i have made the part of the markers correctly please check it, marker = createMarker(1615.48865, -1506.98303, 12.20866,"cylinder", 2, 255, 0, 0, 255) () getRootElement GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(0.5399,0.6794,0.4063,0.456,"Drug Delivery System ",true) GUIEditor_Button[1] = guiCreateButton(317,345,68,40,"Accept",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(245,346,68,39,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(18,33,438,102,"Deliver the Car to the blip on the radar in LV .\nIf there is any bugs report it to the owners.",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) --to Show the GUI function ToggleDDMenu() if guiGetVisible(GUIEditor_Window[1]) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end addEventHandler("onMarkerHit",marker,ToggleDDMenu) wish to get replayed as soon as possible . thank you.
-
Hello , as the owner of Funny freeroam i would like to introduce you why did i have created this server,and the list of free roles that we need , Indroduction: Free Staff Places: Thank you for reading
-
this isn't working Also i want a table would like this local antiwarping = { {x = 200, y = 200, z = 20, width = 100, depth = 100, height = 15}, -- antiwarp }
-
hello I need help with a simple script but it's kinda hard for me ,i want to create a col shape and disable warping in this area thank you,