-
Posts
1,312 -
Joined
-
Last visited
Everything posted by KariiiM
-
Are you looking for suggestions or for scripters?
-
Try that, it may works and tell me the result --client side addEventHandler("onClientVehicleExplode", getRootElement(), function() -- or root, or getLocalPlayer setElementData( localPlayer, "neon", 0 ) -- Zerar local theVehicle = getPedOccupiedVehicle ( localPlayer ) triggerServerEvent ("detachNeon", getLocalPlayer(), theVehicle) end) --server side local neons = {} function detachNeon( theVehicle ) for index, v in pairs(neons[theVehicle]) do if v and isElement(v) then destroyElement(v) end end end addEvent( "detachNeon", true ) addEventHandler( "detachNeon", getRootElement(), detachNeon ) function onPlayerQuit() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local getNeonType = getElementData(source, "neon") if ( getNeonType ) then setAccountData ( playeraccount, "neon", getNeonType) local theVehicle = getPedOccupiedVehicle ( source ) if ( getNeonType ~= 0 ) and ( theVehicle ) then detachNeon( theVehicle ) end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local getNeonTypeAccData = getAccountData ( playeraccount, "neon" ) if ( getNeonTypeAccData ~= 0 ) then setElementData(source, "neon", getNeonTypeAccData) end end end addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
-
When the vehicle explode or when the player quit?
-
His topic title says (problem with "return") ,so I focused on what he wants to do, which value wants to return let's wait his answer
-
Not correct, What do you want to make?
-
You're in the wrong section which it's an english section, you can post your problem in the Spanish section. So you can clearly explain your problem better and what you want to do in a language you're master in and actually it's your main. Here you go: https://forum.multitheftauto.com/viewforum.php?f=122
-
Good point, I hope he start make some efforts.
-
Should works, copy the whole code carefully. function fly(_,target) if target then local targetplayer = getPlayerFromParticalName(target) if targetplayer then local vehicle = getPedOccupiedVehicle(targetplayer) if (isVehicleOnGround(vehicle) == true) then local sx, sy, sz = getElementVelocity (vehicle) setElementVelocity( vehicle ,sx+0.5, sy, sz+0.6 ) outputChatBox(getPlayerName(targetplayer).." #CFECEC was KICKED #ffcc33UP UP #00ff33", 213, 255, 255, true) end end end end addCommandHandler("flyman",fly) function getPlayerFromParticalName (name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
-
Currently I am kinda busy and what you need isn't really easy it will take from me minutes to do it correctly
-
Contacte moi pour beaucoup des informations.
-
What about try doing it by yourself? and post what you've done with and keep your money to you.
-
Try that, addEventHandler("onClientRender", getRootElement(), function () local x, y, z = -2844.7275390625,1290.7978515625,7.1015625 local mx, my, mz = getCameraMatrix() local distance = getDistanceBetweenPoints3D(x,y,z,mx,my,mz) local X, Y = getScreenFromWorldPosition(x,y,z+1.1,0.05) if (distance < 10) then if (X and Y) then dxDrawText("Mechanic", X, Y, X, Y, tocolor(255,255,255,255), 1, "default", "center", "center", false, false, false, false, false) end end end )
-
Yes it's possible, you've to get the object's position and apply that on your code
-
Show a full code because the problem is on onClientRender event the error says ,this event is already handled
-
Try that, function(thePlayer) local owner = getAccountName(getPlayerAccount(thePlayer)) local check = dbPoll(dbQuery(connection,"SELECT Id FROM purchasedCars WHERE Owner = ? AND Slot = ?",tostring(owner),1),-1) if type(check) == "table" and #check > 0 then local id = tostring(check[1]["Id"]) local x,y,z = getElementPosition(thePlayer) createVehicle(id,x+5,y+5,z) end end
-
It should works correctly, try it and tell me the result addEventHandler("onClientRender", getRootElement(), function () for k,veh in pairs(getElementsByType("vehicle")) do if isElementOnScreen(veh) then local x, y, z = getElementPosition(veh) local X, Y = getScreenFromWorldPosition(x,y,z) local px, py, pz = getElementPosition(getLocalPlayer()) local dist = getDistanceBetweenPoints3D(x,y,z,px,py,pz) if dist < 40 then if X and Y then dxDrawText("TEXT", X, Y, X, Y, tocolor(255,255,0,255),1.5, "bankgothic", "center") end end end end end)
-
Yeah now I got you, try that addEventHandler("onClientRender", getRootElement(), function () for k,veh in pairs(getElementsByType("vehicle")) do if isElementOnScreen(veh) then local x, y, z = getElementPosition(veh) local X, Y = getScreenFromWorldPosition(x,y,z) local px, py, pz = getElementPosition(getLocalPlayer()) local test = getDistanceBetweenPoints3D(x,y,z,px,py,pz) if test < 40 then dxDrawText("TEXT", X, Y, X, Y,tocolor(255,255,0,255),1.5,"bankgothic", "center")) end end end end)
-
addEventHandler("onClientRender", getRootElement(), function () for k,veh in pairs(getElementsByType("vehicle")) do if isElementOnScreen(veh) then local x, y, z = getElementPosition(veh) local X, Y = getScreenFromWorldPosition(x,y,z) local px, py, pz = getElementPosition(getLocalPlayer()) local test = getDistanceBetweenPoints3D(x,y,z,px,py,pz) if test < 40 then dxDrawText("TEXT",353,675,671,713,tocolor(255,255,0,255),1.10,"arial","left","top",false,false,false) end end end end)
