Fist
Members-
Posts
433 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Fist
-
createWeapon creates custom weapon which you can create so many cool things with (place weapon on car, on plane, make turrets out of and way more) but with giveWeapon just gives a weapon to specified player from GTA's weapon list.
-
You can, but not as much. You can't create new weapon for player (like default, only custom one). You can't change weapon slot, Also few other things.
-
It actually is weird, 'cause in ACL.XML you can do this, but weirdly not in resource's .xml
-
screw weapon sync, we need more customization of weapons.
-
Would be great if you could make that you can trigger certain type of commands that you add that are only triggerable with console (F8 or ~). I don't think it's that hard to add either, something like extra parameter for addCommandHandler that will make command only work on console. But i'm not sure or it's that necessary, but would be great none the less.
-
there is specific function to change ped walking style with setPedWalkingStyle
-
Powers to ban yourself.
-
I created this for my own needs, but i thought that i gonna share with this depending on how simple this script is, but yet very cool and useful. This command handler will even work with any kind of chat unless source is not a player. You can change command line which triggers commands in shared.lua file You can add your own commands like this (very simple) -- shared addCustomCommandHandler(string command, function handlerFunction) -- export shared exports.RESOURCENAME:addCustomCommandHandler(string command, function handlerFunction) -- client !clientcommands <-- pre-built command to view client commands -- server !servercommands <-- pre-built command to view server commands resource download: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14380 screenhot:
-
If you need any font next time, i recommend you to google this > "Get font name from a image".
-
Why not just to name every element with different names then?
-
You still can add extra check variable like this function shootingWhileMoving() for i=23,34 do if (i ~= 28) then local wepid = i; for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(wepid, level, "flag_move_and_aim", true) setWeaponProperty(wepid, level, "flag_move_and_shoot", true) end end end end but agreed, in this case would better just to use table.
-
you used my example? Try this then function shootingWhileMoving() for i=23,34 do local wepid = i; for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(wepid, level, "flag_move_and_aim", true) setWeaponProperty(wepid, level, "flag_move_and_shoot", true) end end end
-
this is better way to write it, less code required. function shootingWhileMoving() for i=23,34 do for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(i, level, "flag_move_and_aim", true) setWeaponProperty(i, level, "flag_move_and_shoot", true) end end end
-
you can't cancel this event on server side to stop damage, you have to do this through client side.
-
no need for getTickCount, there is function to get remaining time and other info about timer with getTimerDetails. + i already did that, but i thought it was possible to do this way and then code looks way cleaner which i like more but looks like it's not possible. what? Why resourceRoot? I created element dummy that i use to sync data between client and server when i need to.
-
Maybe those vehicles have been created on client side. Information from wiki createVehicle. Note: Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only.
-
To get how much time is left in timer to show it on screen for client and timer is being used on server side to tell when end Round.
-
As title says, how can i pass timer that has been created on server side to the client? I tried doing with setElementData(element,"timer",timer) as it is synced between server and client but when i tried to get timer with getElementData(element,"timer") on client it returned nothing but when i try it on server side, all works. Any solutions?
-
You have to use attachElement and moveObject, but you can't do this without timers, there is no other way to tell when object is finished moving.
-
I'm pretty sure you can't get process of download which is MTA's built-in, you have to make your own downloader for that. Not sure how to do it though, i'm guessing using fetchRemote.
-
you have to put that generateRandomGroupNumbers function what i wrote above "local table = generateRandomNumbers()"
-
Everytime you press E it will call this function generateRandomGroupNumbers() and everytime it calls it, it will delete previous numbers and get new ones. So solution for this is that you have to call it only once. local table = generateRandomGroupNumbers() function checkBar(source) local check1 = guiScrollBarGetScrollPosition ( bar ) for _,v in ipairs(table) do if (v == check1) then guiSetVisible(Window,false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), openLockedCrate) --triggerServerEvent () end end end bindKey ( "E", "down", checkBar )
-
oh didn't pay attention on that. here is working version. client: function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") end end end end addEventHandler("onClientRender",root,function() for _,v in pairs(getElementsByType("player")) do if (getElementData(v,"isVIP")) then dxDrawTextOnElement(v,"VIP",1,50,255,20,20,255,1,"arial") end end end) server: addEventHandler("onPlayerLogin",root,function() if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Vip"))) then setElementData(source,"isVIP",true) end end)
-
client side function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") end end end end addEventHandler("onClientRender",root,function() for _,v in pairs(getElementsByType("player")) do if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)),aclGetGroup("Vip"))) then dxDrawTextOnElement(v,"VIP",1,50,255,20,20,255,1,"arial") end end end)