 
        Karuzo
Members- 
                Posts1,213
- 
                Joined
- 
                Last visited
Everything posted by Karuzo
- 
	Thank you for your reply, but as you can see that's not that nice :3
- 
	Yeah, did that, but isn't there a better picture than the one i've found ? it has the resolutions 900x900, i think there could be more //Edit: Is there a way to rotate the radar ?
- 
	Well i use the one which is in F11, i can't find another one.
- 
	Hey Blaawee! Thank you! it works perfect! But i've got one problem : The radar has a low-quality, i can't see the streets, and i want that the players could see the streets with let's say a scale 2.4. Hope you understand me
- 
	Hmm, i think it's just an error which i can't see.
- 
	So i think i got it, but the problem is the localPlayer's icon is not at the right location. idk why, The Screenshot: My Code: addEventHandler("onClientRender",root, function() showPlayerHudComponent("radar", false) local px,py,pz = getElementPosition(localPlayer) local screenx, screeny = guiGetScreenSize() local bx = 256 local by = 200 local ppx = 5 local ppy = 5 local box_screen_x = (screenx/100) local box_screen_y = (screeny/100*90)- by local point_x = (3000+px)/6000*256 local point_y = (3000-py)/6000*(bx-by) dxDrawImageSection(box_screen_x, box_screen_y, 256, 200,bx+(px*256/6000),by-(py*200/6000), 256, 200, "files/map.png") --dxDrawImage(box_screen_x, box_screen_y,bx,by,"files/map.png") dxDrawImage(box_screen_x+point_x, box_screen_y+point_y, ppx, ppy,"files/me.png")--Localplayers Icon --[[for i, v in ipairs( getElementsByType('player') ) do --Don't care to this. if v ~= localPlayer then local scale = 256/(3000*2) local apx,apy,apz = getElementPosition(v) local point_xx = box_screen_x+apx*scale local point_yy = box_screen_y+apy*scale dxDrawImage(point_xx, point_yy, ppx, ppy,"files/them.png") end end--]] end) i know i know , the code is mess, but i'm just tryin' something new and didn't do that before.
- 
	Thank you , gonna watch out for it if i use postGUI
- 
	Hello everyone, I have a problem with my radar. I want to draw a part of the map.png , let's say just 150x150 of the map.png with a little zoom or smth like that. Example(i don't want that Zoom Level^^): I want to show a part of the radar , like in the picture. Here's my code what i've got atm. addEventHandler("onClientRender",root, function() showPlayerHudComponent("radar", false) local px,py,pz = getElementPosition(localPlayer) local screenx, screeny = guiGetScreenSize() local bx = 200 local by = 200 local ppx = 5 local ppy = 5 local box_screen_x = (screenx/100) local box_screen_y = (screeny/100 *98)- by local point_x = (3000+px)/6000*200 local point_y = (3000-py)/6000*200 dxDrawImage(box_screen_x, box_screen_y,bx,by,"files/map.png") dxDrawImage(box_screen_x+point_x, box_screen_y+point_y, ppx, ppy,"files/redicon.png") for i, v in ipairs( getElementsByType('player') ) do if v ~= localPlayer then local apx,apy,apz = getElementPosition(v) local point_xx = (3000+apx)/6000*200 local point_yy = (3000-apy)/6000*200 dxDrawImage(box_screen_x+point_xx, box_screen_y+point_yy, ppx, ppy,"files/blueicon.png") end end end) Hope you understood me
- 
	function createTheGate () myGate1 = createObject ( 2435, 2434.75488, -1380.33496, 22.10521, 0, 0, 269.995 ) myGate2 = createObject ( 2435, 2427.05176, -1380.25488, 22.10521, 0, 0, 269.995 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) ---- Base ---- function openMyGate () local thePlayer = source local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Survivors" ) ) then moveObject ( myGate1, 4000, 2437.8999, -1380.19995, 22.1 ) moveObject ( myGate2, 4000, 2424.1001, -1380.40002, 22.1 ) else outputChatBox("You're not in the Survivors Group!", thePlayer, 125, 0, 0, false) end end addCommandHandler("test",openMyGate) function movingMyGateBack () if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Survivors" ) ) then moveObject ( myGate1, 4000, 2434.75488, -1380.33496, 22.10521 ) moveObject ( myGate2, 4000, 2427.05176, -1380.25488, 22.10521 ) else outputChatBox("You're not in the Survivors Group!", thePlayer, 125, 0, 0, false) end end addCommandHandler("testclose",movingMyGateBack)
- 
	And stop the sound with onClientColShapeLeave :')
- 
	Ah! Know i understand arezu, thank you for your help! @Citizen: I mean dxSetRenderTarget and dxCreateRenderTarget
- 
	We're not going to make it for you , buddy. Search for a drug-system on the community site, i'm sure there are a few scripts. If you have a code where you don't find the error , show it to us, but as i said, we're not going to make it for you. So it doesn't get Offtopic: I would make it with XML , cause you can just read out how much drugs he has and so on. btw: can't you make normal titles?
- 
	Yeah, if the script is server-sided and you copy&pasted the serverside script of isPlayerInTeam then it should work. But you should change police into the player element, cause the first parameter is the player.
- 
	Ah ok. I just found an useful function which could help you with that. https://wiki.multitheftauto.com/wiki/IsPlayerInTeam
- 
	What? I don't understand you.
- 
	idk if this would work, local thePlayer = source police = getPlayerTeam (thePlayer) if getTeamName(police) == "Police" then --your code end
- 
	What do you mean with all typed in server.lua ? Could you be more specific please ? If you want to trigger an Event just uste triggerServerEvent.
- 
	Where is bindKF2 called ? That doesn't makes sense. delete the function bindKF2 line.
- 
	What do you mean with he will do all server.lua ? You could trigger to the Server if he clicks on a button just like this: addEventHandler("onClientGUIClick", yourbutton, function() triggerServerEvent("YourEvent", localPlayer) outputChatBox("Test") end)
- 
	That's exactly what Citizen gave you.
- 
	Sup Community, i have a question 'bout dxCreate/dxSet - RenderTarget , i don't understand how this actually works. A friend of mine explained it to me, but i just don't get it. I think it's like a box or smth like that, so the dx Creations won't go outside of it. Or is it like a parent but just for the DirectX Creations ? But i don't really know if that's true, and i would be so happy if someone could explain that to me. Regards, KRZO.
- 
	Thank you, works perfectly
- 
	No, he means you should use it global, otherwise you couldn't use it in your LS Func, 'cause the blip was created locally in the function and the LS function won't know that there is this blip.
- 
	Hey Guys, first of all , i just wanted to tell you that i'm so happy that you try to solve my problem ok so, I did what Citizen and Wei said, it works everything, but i have a problem: If i leave the car and enter it , dbgscript 3 gives me an error: My Code: Client: local Motor function MotorOn() if not Motor then Motor = guiCreateStaticImage(X,Y, Width, Height,"data/engine_on.png", false) else guiStaticImageLoadImage(Motor, "data/engine_on.png") end end addEvent("OnMotor", true) addEventHandler("OnMotor", root, MotorOn) function MotorOff() guiStaticImageLoadImage(Motor, "data/engine_off.png") end addEvent("OffMotor", true) addEventHandler("OffMotor", root, MotorOff) Server: local enginestate = {} function motor_func(player) local veh = getPedOccupiedVehicle(player) if veh then setVehicleEngineState(veh,not enginestate[veh]) enginestate[veh] = not enginestate[veh] if (enginestate[veh]) then triggerClientEvent("OnMotor", player) else triggerClientEvent("OffMotor", player) end end end function light_func(player) local veh = getPedOccupiedVehicle(player) if veh then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh,2) else setVehicleOverrideLights(veh,1) end end end addEventHandler("onVehicleEnter",getRootElement(),function (player, seat) if seat == 0 then outputChatBox("Starte den Motor mit 'X' und die Lichter mit 'L'",player,0,125,0) enginestate[source] = false setVehicleEngineState(source, false) triggerClientEvent(player,"OffMotor", player) bindKey(player,"l","down",light_func, player) bindKey(player,"x","down",motor_func, player) end end) addEventHandler("onVehicleExit",getRootElement(),function (player, seat) if seat == 0 then unbindKey(player,"l","down",light_func) unbindKey(player,"x","down",motor_func) triggerClientEvent(player, "CloseMotor", player) end end)
