-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
local praia = -- it's a local variable remove the word local. -- or put the event hanlder "onMarkerHit" inside the function.
-
replace the function name test with an other one.
-
i don't know what you want exactly i just fixed your code. local accounts = { {"acountName here","elementData", "level"} -- example1 {"test","adminlevel",1} {"acountName here","elementData", "level"} -- example2 {"test","vip",1} } function staff (_,acc) for i,v in pairs (accounts) do if (getAccountName(acc) == v[1]) then setElementData(source,v[2],v[3]) end end end addEventHandler("onPlayerLogin", getRootElement(), staff) function onQuit() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local adminlevel = getElementData(source, "adminlevel") local viplevel = getElementData(source, "vip") if adminlevel then setAccountData(account,"adminlevel",adminlevel) end if viplevel then setAccountData(account,"vip",viplevel) end end end addEventHandler("onPlayerQuit",root,onQuit) function onLogin(_,currentAcc) if currentAcc and not isGuestAccount(currentAcc) then local loadadminlevel = getAccountData(currentAcc,"adminlevel") or 0 local loadviplevel = getAccountData(currentAcc,"vip") or 0 setElementData(source,"adminlevel",loadadminlevel) setPlayerExp(source,"vip",loadviplevel) end end addEventHandler("onPlayerLogin",root,onLogin) function adminver (player) if player and isElement(player) then if (getElementData(player,"adminlevel") == 4) then setElementData(source,"blood",500000) outputChatBox("Kaptál 500000 vért",player,255,255,255,true) else outputChatBox("Nincs elég nagy rangod hozzá!",player,255,255,255,true) end end end addCommandHandler("adminver",adminver) function adminlevel (player) if player and isElement(player) then local alvl = getElementData(source,"adminlevel") if alvl then outputChatBox("Az adminszinted : "..alvl,player,255,255,255,true) end end end addCommandHandler("adminlevel",adminlevel)
-
local x,y = guiGetScreenSize() atad = guiCreateButton( x/2+150+150,y/2+(423/2)+57,150,43, "", false ) addEventHandler ( "onClientGUIClick",guiRoot, function ( ) if (source == atad) then triggerServerEvent("testevent", resourceRoot) outputChatBox("asdadadadadasdasda",255,0,0) end end ) function test() outputChatBox("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",client,255,0,0) end addEvent("testevent", true) addEventHandler("testevent",resourceRoot, test)
-
simply it can be like this local myGate1 = createObject ( 3037, -2694.6999511719, 1394.5999755859, 8.3000001907349, 0, 0, 90 ) function openMyGate (player,cmd) if player and isElement(player) then local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local accountName = getAccountName(account) if isObjectInACLGroup("user."..accountName, aclGetGroup("OMEGA")) then if cmd == "open" then moveObject(myGate1, 3037, -2694.6999511719, 1394.5999755859, 3.000000) elseif cmd == "close" then moveObject ( myGate1, 3037, -2694.6999511719, 1394.5999755859, 8.3100004196167 ) end end end end end addCommandHandler("gate",openMyGate) use /gate open : to open the gate. use /gate close: to close the gate.
-
function hospital() if (source == hospitalButton) then exports.texts:output("You are now on LV Hospital! ", 0, 255, 0) setElementPosition (localPlayer, 1614, 1817, 10 ) end end addEventHandler ( "onClientGUIClick", guiRoot, hospital)
-
Sorry i don't undrestand your english. anyways try to remove this line : if SFgang == getElementData(robber, "gang") then should be like this : function SFshareMoney(robbers) local players = getElementsByType("player") local maxmoney = robbers * 250000 local money = math.floor(math.random(maxmoney /2 , maxmoney)) local money = money / robbers for i, robber in pairs (players) do if getElementDimension(robber) == 2 and getElementInterior(robber) == 3 and criminalTeams[getTeamName(getPlayerTeam(robber))] and isPedDead(robber) == false then exports.RPGcommands:giveMoney(robber, money) outputChatBox("You received ".. money .. "$ from robbery", robber) setElementData(robber, "robbedBank", "true", false) end end end
-
simply , as GTX said you can change the Nametags_Distance because you already have all those function. local Nametags_Distance = 200 Edit: Check my first post
-
strings = { { "^%[[%w@]+%]", " " }, } nametags_Root = getRootElement() nametags_ResRoot = getResourceRootElement(getThisResource()) nametags_Players = getElementsByType('player') nametags_Me = getLocalPlayer() nametag = {} local nametags = {} local sWidth,sHeight = guiGetScreenSize() local Nametags_Hide = false local Nametags_Scale = 0.30 local Nametags_Alpha_Distance = 50 local Nametags_Distance = 200 local Nametags_Alpha = 255 local Nametags_Width = 50 local Nametags_Height = 20 local Nametags_Size = 0.3 Nametags_Scale = 1/Nametags_Scale * 800 / sHeight local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametags.Create ( player ) nametags[player] = true end function nametags.Destroy ( player ) nametags[player] = nil end addEventHandler ( "onClientRender", nametags_Root, function() local x,y,z = getCameraMatrix() for player in pairs(nametags) do while true do if not isElement(player) then break end if getElementDimension(player) ~= getElementDimension(nametags_Me) then break end local px,py,pz = getElementPosition ( player ) local bx, by, bz = getPedBonePosition( player, 5 ) if processLineOfSight(x, y, z, px, py, pz, true, false, false, true, false, true) then break end local playerDistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if playerDistance <= Nametags_Distance then --Get screen position --local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) local sx,sy = getScreenFromWorldPosition( bx + 0, by, bz + 0.3 ) if not sx or not sy then break end --Calculate our components local scale = 1/(Nametags_Scale * (playerDistance / Nametags_Distance)) local alpha = ((playerDistance - Nametags_Alpha_Distance) / Nametags_Alpha_Diff) alpha = (alpha < 0) and Nametags_Alpha or Nametags_Alpha-(alpha*Nametags_Alpha) scale = math.evalCurve(maxScaleCurve,scale) local textScale = math.evalCurve(textScaleCurve,scale) local textAlpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = Nametags_Outline_Thickness*(scale) --Requirements local team = getPlayerTeam(player) local offset = (scale) * Nametags_Text_Bar_Space/2 local playerName = getPlayerName(player) local r, g, b = getPlayerNametagColor(player) local chatState = isChatBoxInputActive(player) or isConsoleActive(player) local imageSize = dxGetFontHeight ( textScale*Nametags_Size, "arial" ) for k,v in ipairs (strings) do if string.find( string.lower ( playerName ),v[1]) then playerName = playerName:gsub ( v[1], v[2] ) end end --Draw our text dxDrawText ( playerName, sx+1, sy - offset+1, sx+1, sy - offset-1, tocolor(0,0,0,200), textScale*Nametags_Size*1, "arial", "center", "bottom", false, false, false, true, true ) -- Shadow dxDrawText ( playerName, sx, sy - offset, sx, sy - offset, tocolor(r,g,b,255), textScale*Nametags_Size*1, "arial", "center", "bottom", false, false, false, true, true ) nameWidth = dxGetTextWidth ( playerName, textScale*Nametags_Size, "arial" ) end end end end )
-
try : toggleControl() onResourceStart onPlayerJoin
-
addCommandHandler("vipmenu", function (player) if player and isElement(player) then local account = getPlayerAccount (player) if account and not isGuestAccount(account) then local accName = getAccountName (account) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "V.I.P" ) ) then triggerClientEvent (player,"vipme",player) end end end end )
-
Nvm i thought that you are using a custom function. Sorry i'm using the phone.
-
old it's not defined in your code. replace it with oldTeam.
-
It's a table all what you need is for i , v in pairs ( markers) do local x,y,z = getElementPosition(v) -- You code here end
-
All what you need is : createBrowser() guiGetBrowser() onClientBrowserCreated loadBrowserURL() dxDrawMaterialLine3D()
-
it's handlingsTable not handlingtable. if it doesn't work try to use sth like this if ( not handlingsTable[vehicle] ) then handlingsTable[vehicle] = {} end handlingsTable[vehicle] = {--[[ put your value here]]}
-
function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 if walk then setPedWalkingStyle(source, tonumber(walk)) end end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
-
function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 if walk then setPedWalkingStyle(source, tonumber(walk)) end end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
-
Yes i know i already got the idea from CIT server and i tried to make it more better . anyways thx .
-
you are welcome.