-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
i don't forgot anything, the brackets is not needed the code can work with brackets and can work without brackets.
-
lift = createObject (3095, -1851, -3112.1000976563, 51.700000762939, 0, 0, 228.49365234375) function open(player) local acc = getAccountName(getPlayerAccount(player)) if acc then if isObjectInACLGroup("user." .. acc, aclGetGroup("Admin")) then moveObject(lift, 2500, -1851, -3112.1000976563, 38.900001525879) end end end function close(player) local acc = getAccountName(getPlayerAccount(player)) if acc then if isObjectInACLGroup("user." .. acc, aclGetGroup("Admin")) then moveObject (lift, 2500, -1851, -3112.1000976563, 51.700000762939) end end end function bind(hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then bindKey(hitPlayer, ",", "down", open) bindKey(hitPlayer, "/", "down", close) end end addEventHandler("onColShapeHit", col, bind) function unbind(leaveElement, matchingDimension) if getElementType(leaveElement) == "player" then unbindKey(leaveElement, ",", "down", open) unbindKey(leaveElement, "/", "down", close) end end addEventHandler("onColShapeLeave", col, unbind)
-
do you want the gate open when an admin hit the col? or just bind a key to open/close the gate when the admin hit the col? maybe this what you want? lift = createObject (3095, -1851, -3112.1000976563, 51.700000762939, 0, 0, 228.49365234375) function open(player) local acc = getAccountName(getPlayerAccount(player)) if acc then if isObjectInACLGroup("user." .. acc, aclGetGroup("Admin")) then moveObject(lift, 2500, -1851, -3112.1000976563, 38.900001525879) end end end function close(player) local acc = getAccountName(getPlayerAccount(player)) if acc then if isObjectInACLGroup("user." .. acc, aclGetGroup("Admin")) then moveObject (lift, 2500, -1851, -3112.1000976563, 51.700000762939) end end end function bind(hitPlayer, matchingDimension) bindKey(hitPlayer, ",", "down", open) bindKey(hitPlayer, "/", "down", close) end addEventHandler("onColShapeHit", col, bind) function unbind(leaveElement, matchingDimension) unbindKey(leaveElement, ",", "down", open) unbindKey(leaveElement, "/", "down", close) end addEventHandler("onColShapeLeave", col, unbind)
-
lift = createObject (3095, -1851, -3112.1000976563, 51.700000762939, 0, 0, 228.49365234375) function open(hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then local acc = getAccountName(getPlayerAccount(hitPlayer)) if isObjectInACLGroup("user." .. acc, aclGetGroup("Admin")) then moveObject(lift, 2500, -1851, -3112.1000976563, 38.900001525879) end end end addEventHandler("onColShapeHit", col, open) function close(leaveElement, matchingDimension) if getElementType(leaveElement) == "player" then local acc = getAccountName(getPlayerAccount(leaveElement)) if isObjectInACLGroup("user." .. acc, aclGetGroup("Admin")) then moveObject (lift, 2500, -1851, -3112.1000976563, 51.700000762939) end end end addEventHandler("onColShapeLeave", col, close) function binding() for i,player in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then bindKey(player, ",", "down", open) bindKey(player, "/", "down", close) end end end addEventHandler("onResourceStart", resourceRoot, binding)
-
where the server side? also this is wrong playSound("/music/XS.mp3",false) it's should be playSound("music/XS.mp3",false)
-
@Jaysds1 i've tested what i am post and it's work
-
show your script
-
you want the player name showing in the screen when he is join - quit? ok where is your script? the server won't appear anything by his self -_-"" what i post was just adjust to all resolutions
-
what is doesn't work? i tested this and working with all resolution i don't understand what is not work can you put an image? function AbsoluteToRelativ2( X, Y ) local rX, rY = guiGetScreenSize() local x = math.floor(X*rX/1280) local y = math.floor(Y*rY/720) return x, y end function DXdraw() local x1, y1 = AbsoluteToRelativ2( 959,246 ) local x2, y2 = AbsoluteToRelativ2( 956,243 ) dxDrawText("textQuit", x1, y1, 1224, 264, tocolor(0,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText("textQuit", x2, y2, 1224, 261, tocolor(255,0,0,255),0.6,"bankgothic","left","top",false,false,false) end addEventHandler("onClientRender", root, DXdraw)
-
who is source? function binding() for i,player in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then bindKey(player, ",", "down", open) bindKey(player, "/", "down", close) end end end addEventHandler("onResourceStart", resourceRoot, binding)
-
--Client Side-- local EvMarker = createMarker ( 1547.88953, -1681.53955, 12.5, 'arrow', 2, 255, 0, 0, 255 ) EvGui = guiCreateWindow(333,326,185,220,"SARG Event panel 0.1",false) guiSetVisible(EvGui, false) showCursor (false) guiSetInputEnabled(false) EvTabPan = guiCreateTabPanel(10,20,166,191,false,EvGui) EvTab = guiCreateTab("Rules",EvTabPan) EvMemo = guiCreateMemo(6,4,155,182,"The rules of the event: There are 2 teams, armed with spray, the goal is to eliminate the enemy team with the spray, admins can stop the event by typing: /stop ()Events",false,EvTab) guiMemoSetReadOnly(EvMemo,true) EvTab2 = guiCreateTab("START!",EvTabPan) Start = guiCreateButton(23,33,129,64,"START EVENT",false,EvTab2) addEventHandler("onClientMarkerHit", EvMarker, function(hitElement) if (hitElement == localPlayer) then if (guiGetVisible(EvGui) == false) then guiSetVisible(EvGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("The event is not ready yet.") end end end) function ButtClick(button,state) triggerServerEvent("StartKnop",localPlayer) guiSetVisible(EvGui, false) showCursor (false) guiSetInputEnabled(false) end addEventHandler ( "onClientGUIClick", Start, ButtClick ) --Server Side-- local evmarkerred local evmarkerblue addEvent("StartKnop", true) addEventHandler("StartKnop", root, function() evmarkerred = createMarker ( 1547.88953, -1683, 12.5, 'cylinder', 2, 255, 0, 0, 255 ) evmarkerblue = createMarker ( 1547.88953, -1686, 12.5, 'cylinder', 2, 0, 0, 255, 255 ) addEventHandler("onMarkerHit", evmarkerred, mhit1) addEventHandler("onMarkerHit", evmarkerblue, mhit2) end) function mhit1 ( hitElement ) if (getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement )) then setElementPosition ( hitElement,2838.6000976563, -2527.6999511719, 19 ) giveWeapon ( hitElement, 41, 100000 ) removeEventHandler("onMarkerHit", evmarkerred, mhit1) removeEventHandler("onMarkerHit", evmarkerblue, mhit2) destroyElement (evmarkerred) destroyElement (evmarkerblue) end end function mhit2 ( hitElement ) if (getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement )) then setElementPosition ( hitElement,2837.6999511719, -2333, 12 ) giveWeapon ( hitElement, 41, 100000 ) removeEventHandler("onMarkerHit", evmarkerred, mhit1) removeEventHandler("onMarkerHit", evmarkerblue, mhit2) destroyElement (evmarkerred) destroyElement (evmarkerblue) end end
-
example local screenWidth, screenHeight = guiGetScreenSize() function createText ( ) local money = getPlayerMoney(localPlayer) dxDrawText( "Your Money: "..tostring(money), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1, "pricedown" ) end addEventHandler("onClientRender",root, createText)
-
Can you tell me what the link between this exports.scoreboard:addScorboardColumn('Money') function M () local money = getPlayerMoney (source) setElementData (source, "Money", "$".. money ) end end addEventHandler ("onPlayerSpawn", getRootElement(), M ) and this function xxx () local screenWidth, screenHeight = guiGetScreenSize() local name = getPlayerName() local money = getPlayerMony(thePlayer) you want dxDrawText i don't understand why you put a script for add money in Scoreboard ---------------- this make no sense. function xxx () local screenWidth, screenHeight = guiGetScreenSize() local name = getPlayerName() local money = getPlayerMony(thePlayer) look at wiki https://wiki.multitheftauto.com/wiki/GetPlayerName https://wiki.multitheftauto.com/wiki/DxDrawText
-
in Text? what do you mean
-
i found another thing addEventHandler("onClientGuiClick", root, function Event(button,state) if (source == Start) then triggerServerEvent("StartKnop",getLocalPlayer()) end end) should be addEventHandler("onClientGuiClick", root, function(button,state) if (source == Start) then triggerServerEvent("StartKnop",getLocalPlayer()) end end) Edit: this too EvMemo = guiCreateMemo(6,4,155,182,"The rules of the event: There are 2 teams, armed with spray, the goal is to eliminate the enemy team with the spray, admins can stop the event by typing: /stop ()Events",false,GUIEditor_Tab[1]) correct EvMemo = guiCreateMemo(6,4,155,182,"The rules of the event: There are 2 teams, armed with spray, the goal is to eliminate the enemy team with the spray, admins can stop the event by typing: /stop ()Events",false,EvTab)
-
could you take a shot screen to see where is the dx on the screen? Edit: try this should work 99.9% function AbsoluteToRelativ2( X, Y ) local rX, rY = guiGetScreenSize() local x = math.floor(X*rX/1280) local y = math.floor(Y*rY/720) return x, y end function DXdraw() local x1, y1 = AbsoluteToRelativ2( 959,246 ) local x2, y2 = AbsoluteToRelativ2( 956,243 ) dxDrawText("textQuit", x1, y1, 1224, 264, tocolor(0,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText("textQuit", x2, y2, 1224, 261, tocolor(255,0,0,255),0.6,"bankgothic","left","top",false,false,false) end addEventHandler("onClientRender", root, DXdraw)
-
this addEvent("Event", true) addEventHandler("Event", root, should be addEvent("StartKnop", true) addEventHandler("StartKnop", root,
-
https://wiki.multitheftauto.com/wiki/SetVehicleHandling
-
xmlLoadFile is work Client and server side https://wiki.multitheftauto.com/wiki/XmlLoadFile
-
wtf is this?!! triggerServerEvent (StartKnop, true) addEventHandler("onClientMarkerHit", dutyMarker,
-
addEventHandler("onClientResourceStart", resourceRoot, function() TXD = engineLoadTXD ("skins/lapd1.txd") engineImportTXD (TXD, 280) end)
-
pm from Dev-PoinT to me Dev Point ask what the errors i think he means what is not errors
-
you didn't see my post ! if you say not work then you are crazy LOL local screenWidth, screenHeight = guiGetScreenSize() function createText () addEventHandler ( "onClientRender", root, DrawText ) end addCommandHandler ( "wanted", createText ) function DrawText () wantedLvl = getPlayerWantedLevel() if wantedLvl == 0 then dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1.02, "pricedown" ) else dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1.02, "pricedown" ) end end
-
huh? local screenWidth, screenHeight = guiGetScreenSize() function createText () addEventHandler ( "onClientRender", root, DrawText ) end addCommandHandler ( "wanted", createText ) function DrawText () wantedLvl = getPlayerWantedLevel() if wantedLvl == 0 then dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) else dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) end end
