-
Posts
1,165 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ALw7sH
-
local Time = 2 -- in seconds local Money = 500 local BaseAlianza = createMarker (2794,-2418,12.6,"cylinder",5,255,0,0,255) setTimer(function() for _,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,BaseAlianza) then if isObjectInACLGroup("user."..getAccountName( getPlayerAccount(player) ), aclGetGroup("Anarquia")) then givePlayerMoney (player,Money) end end end end,Time*1000,0)
-
It should be server side because on client side nobody will be able see him even if he shoot
-
fileGetSize ??
-
Idont know but isn't "You are too far away from the garage!" must be outputted if you are not too close for the garage that you are trying to open? but what you did is loop for all objects with id 17950 and check if their id equal to id that you have wrote else output "You are too far away from the garage!" the object should move if "You have opened your garage!" have been outputted because it's under the move object line are sure the positions is not equal to the current object positions? and have you checked if there's any erros on debugscript ?
-
It will work if you just used the function one time but on the second time the variables will be updated to the new positions of the new progressbar and the old progressbar gonna have the new positions of the new progressbar. And dont forget that you are working with function that will be used in onClientRender event My code above is the one of the best ways to do what you are trying to do
-
local result = mysqlSystem:query_database("SELECT x, y, z, interior, dimension, rot1, rot2, rot3 FROM garages WHERE id="..dbid.."") You dont have to use "while" and it's better to use the original mta mysql functions
-
This line local BGstartx, BGstarty, PBstartx, PBstarty, percent, executed; is reset executed everyframe
-
There's no event attached to function two, so why you are using removeEventHandler lol --- You dont really need to delete the event handler just use element data function godMode() if getElementData(source,"godMode") == true then cancelEvent() end end addEventHandler("onClientPlayerDamage",root,godMode)
-
Have a look to attachElements arguments local garage = createObject(17950, tonumber(x), tonumber(y), tonumber(z), tonumber(rot1), tonumber(rot2), tonumber(rot3)) local gate = createObject(17951, tonumber(x)+4.22, tonumber(y)+1.05, tonumber(z)-0.25, tonumber(rot1), tonumber(rot2), tonumber(rot3)-90) attachElements ( gate, garage, 4.22, 1.05,-0.25, 0, 0, -90)
-
function invisible() if getElementModel(localPlayer) == 179 then if getElementAlpha ~= 255 then setElementAlpha(localPlayer, 255) else setElementAlpha(localPlayer, 0) end end end addCommandHandler ( "invisible", invisible )
-
function invisible() if getElementModel(localPlayer) == 179 then setElementAlpha(localPlayer, 0) end end addCommandHandler ( "invisible", invisible )
-
Because as i told you, you cant use dxDraw functions without onClientRender And the server side code is worng as Solidsnake14 already said that
-
You haven't done anything like that it will calculate on every frame and he dont want that
-
You cant calculate it just one time since it's in onClientRender you can do something like that: function dxCreateProgressBar(BGW,BGH,PBW,PBH) if BGW > PBW and BGH > PBH then local pB = createElement("dxProgressBar") local px,py = guiGetScreenSize() local BGstartx = math.floor((px - BGW) / 2) local BGstarty = math.floor((py - BGH) / 2) local PBstartx = math.floor((px - PBW) / 2) local PBstarty = math.floor((px - PBH) / 2) local percent = math.floor(PBW / 100) setElementData(pB,"datas",{BGW=BGW,BGH=BGH,PBW=PBW,PBH=PBH,BGstartx=BGstartx,BGstarty=BGstarty,PBstartx=PBstartx,PBstarty=PBstarty,Percent=percent}) return pB end end function dxDrawProgressBar(ProgressBar,progress,BGcolor,PBcolor) if isElement(ProgressBar) then local datas = getElementData(ProgressBar,"datas") local drawprogress = math.floor(progress * datas.Percent) dxDrawRectangle(datas.BGW,datas.BGstarty,datas.BGW,datas.BGH,BGcolor,true) dxDrawRectangle(datas.PBstartx,datas.PBstarty,drawprogress,datas.PBH,PBcolor,true) end end -------------- local myPB = dxCreateProgressBar(410,51,380,28) addEventHandler("onClientRender",getRootElement(), function() local progress = math.floor((timepast / repairtime) * 100) dxDrawProgressBar(myPB,progress,tocolor(127, 127, 127, 255),tocolor(233, 254, 0, 255)) end )
-
I cant understand what do you mean
-
اذا اللوحة تفك اول مايدخل ماركر احفظ شخصية اللاعب في متغير (getElementModel) واذا ضغط خروج حطها له (setElementModel)
-
You can use onPlayerLogin instead of onResourceStart also dxDraw functions must be in onClientRender event
-
Can you put the code that when player will respawn?
-
Because of your "if not executed then - local executed = true" lines the positions be nil after the first frame also this is useless because even if it works you will have problems if you draw more than 1 progressbar
-
??? lol there is no element data called "Class" in this script : https://community.multitheftauto.com/?p=resources&s=details&id=1152 if getElementData( source, 'Class' ) == 'Heavy' then setPedArmor( source,100 ) --- Xwad you haven't answerd me, where do you set "Class" element dada
-
Wheres your server side? and dont take money on client side you have to take them on server side
-
The code is 100% right, Where you set "Class" element data
-
function dontTryBug(element) if element == localPlayer then if ( guiGetVisible ( oneMinute ) ~= true ) then if source == Marker[2] then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) else if timeRem ~= "1" then if source == Marker[2] then showCursor ( false ) destroyElement ( GUIEditor.window[1] ) end end end end end end addEventHandler("onClientMarkerHit", getRootElement(), dontTryBug)
-
when you create the garage give it element data with the door object element example: local garage = createObject(...) local Door = createObject(...) setElementData(garage,"Door",Door) then when you delete the garage object just get the door element from the element data that you have set and delete it, sorry if my english is not easy to understand because it's bad but hopeful you understand
-
Do you mean if the data in the table return true ?