βurak
Members-
Posts
376 -
Joined
-
Last visited
-
Days Won
22
Everything posted by βurak
-
create a new acl group and add acl privileges as follows <group name="adminSpecial"> <acl name="Default"></acl> <acl name="adminSpecialACL"></acl> </group> <acl name="adminSpecialACL"> <right name="general.adminpanel" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.warp" access="true"></right> </acl> The people you add to the acl group will only have warp and message read privileges.
-
By the way, if that's all the codes are, keys will not be assigned for newly joined players, so add this line. addEventHandler("onPlayerJoin", root, function() bindKey(source, "l", "down", "vehiclelights") end )
-
function consoleVehicleLights (thePlayer) local playerVehicle = getPedOccupiedVehicle ( thePlayer ) if playerVehicle then if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then setVehicleOverrideLights ( playerVehicle, 2 ) else setVehicleOverrideLights ( playerVehicle, 1 ) end end end addCommandHandler ( "vehiclelights", consoleVehicleLights ) addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do bindKey(player, "l", "down", "vehiclelights") end end ) do it this way
-
local zCoordinates = { {-2411.49, -608.29, 131.62, 18.33, 12.49, 1.92}, {-2430.09, -607.45, 131.56, 5.55, 7.24, 1.90} } local zones = {} for i,v in ipairs(zCoordinates) do local theZone = createColCuboid(zCoordinates[i][1], zCoordinates[i][2], zCoordinates[i][3], zCoordinates[i][4], zCoordinates[i][5], zCoordinates[i][6]) table.insert(zones, theZone) end addEventHandler("onColShapeHit", root, function(element) for i=1,#zones do if(source == zones[i]) then if getElementType(element) == "ped" or getElementType(element) == "player" or getElementType(element) == "vehicle" then if getElementAlpha(element) == 255 then setElementAlpha(element, 130) setElementCollisionsEnabled(element, false) end end end end end) addEventHandler("onColShapeLeave", root, function(element) for i=1,#zones do if(source == zones[i]) then if getElementType(element) == "ped" or getElementType(element) == "player" or getElementType(element) == "vehicle" then if getElementAlpha(element) == 130 then setElementAlpha(element, 255) setElementCollisionsEnabled(element, true) end end end end end) try this
- 1 reply
-
- 2
-
-
thanks it worked, now it looks double sided but the rendering problem still persists i will try to split the object
-
hello how can i make the 2d plane visible from both sides it is visible from the outside but not from the inside and the part that I draw with the circle is rendered when the player moves continuously. Is there a way to show a little further? i am using blender 2.93.3 to modelling and i am using max 2009 to convert dff
-
combine it with zombieHealth here's how triggerClientEvent(source, "add:notification", source, "bot hp: "..zombieHealth, "info", true)
-
There is a typo in your code, change it like this You are passing getElementData to the parameter completely as a string local zombieHealth = tostring(getElementData(zomb, "blood")) triggerClientEvent(source, "add:notification", source, zombieHealth, "info", true)
-
take a look at this https://wiki.multitheftauto.com/wiki/CreateMarkerAttachedTo
-
Can you change root to localPlayer? I'm not sure but it might work addEventHandler("onClientWeaponFire", localPlayer, noDamageToPlayersFromCustomWeapons)
-
you already got what you want here what more do you want?
-
The blue team and the red team are separate teams, your code only checks the red team, and if you want to turn off friendlyFire for the blue team, you can do it this way function noDamageToPlayersFromCustomWeapons(target) if(target and getElementType(target) == "player") then local playerTeam = getPlayerTeam(localPlayer) local targetTeam = getPlayerTeam(target) local playerTeamName local targetTeamName if(playerTeam and targetTeam) then playerTeamName = getTeamName(playerTeam) targetTeamName = getTeamName(targetTeam) if (playerTeamName == targetTeamName) then cancelEvent() end end end end addEventHandler("onClientWeaponFire", root, noDamageToPlayersFromCustomWeapons) but remember this will be valid for all teams if you want to create a team with friendly fire on except for blue and red you will need to edit the code
-
Change the if structure where getElementType is like this if(target and getElementType(target) == "player") then
-
try this function noDamageToPlayersFromCustomWeapons(target) if(getElementType(target) == "player") then local playerTeam = exports.Teams:isPlayerInTeam(localPlayer, "Red") local targetTeam = exports.Teams:isPlayerInTeam(target, "Red") if (playerTeam == targetTeam) then cancelEvent() end end end addEventHandler("onClientWeaponFire", root, noDamageToPlayersFromCustomWeapons)
-
yes it is possible getTickCount maybe will work for you? example: local DELAY_TELEPORT = 5000 -- millisecond delay local IntervalTeleport = 0 local teleportMarker = createMarker(0, 0, 3, "cylinder", 3.0, 255, 0, 0, 255) addEventHandler("onMarkerHit", teleportMarker, function(hitElement) if(getElementType(hitElement) == "player") then if(IntervalTeleport and getTickCount() - IntervalTeleport > DELAY_TELEPORT) then --teleport player every 5 second setElementPosition(hitElement, 106.99030, 1924.18860, 18.52914) IntervalTeleport = getTickCount() else outputChatBox("You need to wait 5 seconds!", hitElement, 255, 0, 0, false) end end end )
-
spfont = dxCreateFont("fonts/font.ttf", 21) local isAdded = false function speed() if(isAdded == false) then addEventHandler ("onClientRender", root, getspeed) isAdded = true end end addEventHandler("onClientVehicleEnter", root, speed) function wylacz () if(isAdded == true) then removeEventHandler("onClientRender", root, getspeed) isAdded = false end end addEventHandler("onClientVehicleExit", root, wylacz) function getspeed() local playerVehicle = getPedOccupiedVehicle(localPlayer) if(playerVehicle) then local sx, sy, sz = getElementVelocity(playerVehicle) kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) mphs = math.floor((((sx^2 + sy^2 + sz^2)^(0.5))*180)/1.6) health = getElementHealth(playerVehicle) name = getVehicleName(playerVehicle) currenthealth = math.floor(health/10) screenWidth, screenHeight = guiGetScreenSize() windowWidth, windowHeight = 300,170 left = screenWidth/1.18 - windowWidth/9.8 top = screenHeight/1.03 - windowHeight/20 dxDrawText ( " "..tostring(kmhs).."km/h", left , top +2, screenWidth +2, screenHeight , tocolor ( 255, 255, 255, 255 ), 1, spfont ) dxDrawText ( " "..tostring(kmhs).."km/h", left -2, top, screenWidth, screenHeight -2, tocolor ( 255, 255, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(mphs).."mph", left , top -23, screenWidth +2, screenHeight , tocolor ( 255, 255, 255, 255 ), 1, spfont ) dxDrawText ( " "..tostring(mphs).."mph", left -2, top -25, screenWidth, screenHeight -2, tocolor ( 255, 255, 0, 255 ), 1, spfont ) end end try this
-
use getPedMaxHealth function to find player's max health also use server side to set player's money I'm not sure but it could be like this client: function getPedMaxHealth(ped) -- Output an error and stop executing the function if the argument is not valid assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") -- Grab his player health stat. local stat = getPedStat(ped, 24) -- Do a linear interpolation to get how many health a ped can have. -- Assumes: 100 health = 569 stat, 200 health = 1000 stat. local maxhealth = 100 + (stat - 569) / 4.31 -- Return the max health. Make sure it can't be below 1 return math.max(1, maxhealth) end addEventHandler("onClientClick", root, function(btn, state) if btn == 'left' and state == 'down' then if data.open == true then if isMouseInPosition(screenW * 0.4081, screenH * 0.3932, screenW * 0.1846, screenH * 0.0560) then if (getElementHealth(localPlayer) >= getPedMaxHealth(localPlayer)) then outputChatBox("Your hp is full!") return end if (getPlayerMoney(localPlayer) < 500) then outputChatBox("No money") return else if(getPlayerMoney(localPlayer) > 500 and getElementHealth(localPlayer) < getPedMaxHealth(localPlayer)) then triggerServerEvent("takeMoneyFromPlayer", localPlayer, 500) setElementHealth(localPlayer, getPedMaxHealth(localPlayer)) outputChatBox("Transaction completed") end end end if isMouseInPosition(screenW * 0.6007, screenH * 0.2943, screenW * 0.0176, screenH * 0.0352) then showGUI() end end end server: addEvent("takeMoneyFromPlayer", true) addEventHandler("takeMoneyFromPlayer", root, function(amount) local theAmount = tonumber(amount) takePlayerMoney(source, theAmount) end )
-
You are using getElementData incorrectly, you should write the key you will receive. getElementData(localPlayer, "Key")
-
You can solve this problem by creating an event on client side and running it with triggerClientEvent on server side client: local sound addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() sound = playSound("winsound.mp3") end, 2000, 1) end ) addEvent("stopLoginMusic", true) addEventHandler("stopLoginMusic", root, function() if isElement(sound) then stopSound(sound) end end ) server: addEventHandler("onPlayerLogin", root, function() triggerClientEvent(source, "stopLoginMusic", source) end )
-
you can check it with a variable local isAdded = false function speed() if(isAdded == false) then addEventHandler ("onClientRender", root, getspeed) isAdded = true end end addEventHandler("onClientVehicleEnter", root, speed)
-
it will work like this function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) local vehicleModel if(vehicle) then vehicleModel = getElementModel(vehicle) end if (vehicle and vehiclesNoEngine[vehicleModel]) then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end
-
getPedOccupedVehicle function returns false if player is not found in car so check if player is in car I'm not sure but it should be like this function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) local vehicleModel = getElementModel(vehicle) if (vehicle and vehiclesNoEngine[vehicleModel]) then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end
