-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
Other job mean other script All what you post here is about medic job if you use this function leaveMedic() if isElementVisibleTo(ambulancee, source) then setElementVisibleTo(ambulancee, source, false) end end addEventHandler("setMedic",root,leaveMedic) This will make no sense, because the event is setMedic that mean join medic job not leave medic job. if you still can't get what i am saying, i am sorry i can't help you more than this.
-
24 image in this resource is stolen from my server. https://community.multitheftauto.com/index.php?p=resources&s=details&id=5691 DONE
-
omg Aren't you who want when you take other job, then remove the marker? then how the hell i can know when you take other job what is the event name!
-
function onGuiClick (button, state, absoluteX, absoluteY) if ( source == Button ) then function narBullets() local x,y,z = getPedWeaponMuzzlePosition(localPlayer) x2,y2,z2 = getPedTargetCollision(localPlayer) if not x2 then x2,y2,z2 = getPedTargetEnd(localPlayer) end dxDrawLine3D(x,y,z, x2,y2,z2, tocolor(255,0,0), 2) end addEventHandler("onClientRender", root, narBullets) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick)
-
isElementVisibleTo and setElementVisibleTo is server side function. What other jobs you have?
-
i don't know what is your events/jobs You should knows what events to use when you changing your job like "setPolice" or whatever.
-
Man, you're join Medic and in same time you leave Medic -_-"
-
This to fix it createBlip(2035.1999511719, -1406.5, 16.200000762939, 22) MedicTeam = createTeam ("Medic", 0, 255, 255) ambulancee = createMarker(2001, -1407.1999511719, 15.89999961853, "cylinder", 1.5, 0, 255,255, 255) -- Creates a marker in the center of the map setElementVisibleTo(ambulancee, root, false) function joinMedic() setPlayerTeam(source,MedicTeam) setPlayerNametagColor ( thePlayer, 0, 255, 255 ) setElementVisibleTo(ambulancee, source, true) setElementModel(source,276) giveWeapon(source, 41, 999) setElementData(source, "Occupation", "Medic") outputChatBox("You are now Medic.", source, 0,255,0) end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) addCommandHandler ( "nametagcolor", nametagColorChange ) function leaveMedic() if isElementVisibleTo(ambulancee, source) then setElementVisibleTo(ambulancee, source, false) end end addEvent("medic:healing", true) addEventHandler("medic:healing", root, function (medic) if (getElementHealth(source) < 100) then local Heal = getElementHealth(source) + 10 setElementHealth(source, Heal) if (Heal > 100) then setElementHealth(source, 100) end givePlayerMoney(medic, 100) takePlayerMoney(source, 100) end end) local jobVehicles = {} addEventHandler("onMarkerHit", ambulancee, function(hitElement) if (getElementType(hitElement) ~= "player") then return end if not isElementVisibleTo(ambulancee, hitElement) then return end local x, y, z = getElementPosition(hitElement) local team = getPlayerTeam(hitElement) if(isPedInVehicle(hitElement)) then return end if (isElement(jobVehicles[hitElement])) then destroyElement(jobVehicles[hitElement]) end if (team and getTeamName(team) == "Medic") then jobVehicles[hitElement] = createVehicle(416, x, y, z, 0, 0, 180) setTimer(warpPedIntoVehicle, 250, 1, hitElement, jobVehicles[hitElement]) end end) When you join other job, all you need is put this: leaveMedic()
-
https://wiki.multitheftauto.com/wiki/DxDrawLine3D This function draws a 3D line between two points in the 3D world - rendered for one frame. This should be used in conjunction with onClientRender in order to display continuously.
-
Because you can't change color of the blips icon that aren't "0" https://wiki.multitheftauto.com/wiki/SetBlipColor This function will let you change the color of a blip. This color is only applicable to the default blip icon. All other icons will ignore this.
-
إذا جربت كودك أرسل لي رسالة عشان أفتح لك الموضوع يغلق
-
اول شي bool dxDrawLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, int color[, int width, bool postGUI ] ) انا وين الاقي بداية الليزر و نهايته ثاني شي اذا تابل قد نزله في موضوع ياليت تعطيني الرابط او تابل ينزله هنا بداية الليزر https://wiki.multitheftauto.com/wiki/GetPedTargetStart (نهاية الليزر (يعتمد على مدى تصويب السلاح https://wiki.multitheftauto.com/wiki/GetPedTargetEnd (نهاية الليزر (يعطي أحداثيات الجسم الي أمامك الي يكون أقرب من مدى تصويب السلاح https://wiki.multitheftauto.com/wiki/GetPedTargetCollision
-
https://forum.multitheftauto.com/viewtopic.php?f=119&t=44649
-
mta has one already https://wiki.multitheftauto.com/wiki/Server_Commands#chgmypass
-
Use isTimer better. if isTimer(some_timer) then killTimer(some_timer) end
-
You need server side.
-
local o = 0 for i = 1,5 do o = o + 1 end print(o) --> 5 local o = 0 for i = 1,5 do local o = o + 1 end print(o) --> 0 really? i have tested my code and it work, all you have did is making it global while this not needed since he will not use it outside the function.
-
and my code not work? lol
-
Easy, make the bindKey from server side, and then when you press the key check if he is moderator then trigger to client side and use guiSetVisible/guiGetVisible and showCursor. All you need is this: -- Server Side -- bindKey isObjectInACLGroup triggerClientEvent -- Client Side -- addEvent addEventHandler guiGetVisible guiSetVisible showCursor
-
addEvent("seeIfThereisCrates", true) addEventHandler("seeIfThereisCrates", root, function (player) local objects = 0 for i,elem in ipairs(getElementsByType("object")) do if getElementModel(elem) == 2912 then local objects = objects + 1 end end outputChatBox("client: "..objects) end)
-
The timers look fine, try add outputChatBox inside function setZeit, and see if it does output two times and then stop or not.
