TioTiago
Members-
Posts
26 -
Joined
-
Last visited
Everything posted by TioTiago
-
if you use the resource bone_attach: elementVest = {} function getArmour() local amour = getPlayerArmor(source) if amour > 0 then x,y,z = getElementPosition(source) if not isElement(elementVest[source]) then exports.bone_attach:detachElementFromBone(elementVest[source]) destroyElement(elementVest[source]) elementVest[source] = false end elementVest[source] = createObject(1598,x,y,z) exports.bone_attach:attachElementToBone(elementVest[source],source,3,0,0.02,-0.53,-3,0,90,1) else if elementVest[source] and isElement(elementVest[source]) then exports.bone_attach:detachElementFromBone(elementVest[source]) destroyElement(elementVest[source]) elementVest[source] = false end end end setTimer(getArmour,1500,source) instead of SetTimer could use: addEventHandler("onPlayerDamage",getRootElement(),getArmour)
-
https://wiki.multitheftauto.com/wiki/Se ... leDistance
-
https://wiki.multitheftauto.com/wiki/Se ... leDistance
-
try: addEventHandler("onPlayerCommand",root,function(commandName) if commandName == "bind" or commandName == "unbind" then cancelEvent() end end) server side.
-
there is nothing that can disable uploading GTA (yet) but the tip that let's you set +1 bullet in the magazine, eg M4 with 31 bullets when it comes to one she does not shoot more, just set up the weapon hud to appear - 1 bullet. sorry my english.
-
good work I had made a sketch of a gamemode of rust but do not have more time :c http://i.imgur.com/RquDWXd.jpg
-
how to create a "guiCreateLabel" that moves equal to the MTA ABOUT menu? which function?
-
good work
-
thank you all
-
what is the font used in the Menu MTA, I know they are images, but what's the name of the font used in it?
-
wow good work
-
how to cancel reload? function cancelReload () cancelEvent() end addEventHandler ( "onPlayerReload", getRootElement(), cancelReload) I tried onPlayReload but there is no onPlayReload function so as to cancel the reload? I wanted to leave the manual reload Sorry my bad english
-
solved thanks you is the best
-
even removing getElementModel (hitElement) == 1812 it does not work function onlyFunction (hitElement) if getElementType (hitElement) == "object" then local x,y,z = getElementPosition(hitElement) createPed (0, x, y, z, true) end end addEventHandler ("onClientPlayerWeaponFire", getRootElement(), onlyFunction)
-
Wanted when firing on a bed (id 1812) created a ped, I tried this but to no avail: / function onlyFunction () if getElementType (hitElement) == "object" and getElementModel (hitElement) == 1812 then x,y,z = getElementPosition(hitElement) createPed (0, x, y, z, true) end end addEventHandler ("onClientPlayerWeaponFire", getRootElement(), onlyFunction) O que está errado? ty
-
I also have problems with this function, I can not remove the map lights objects as the window light and other
-
Server function givePlayerXP ( source, valve ) local finalXP = valve local currXP = getElementData ( source, "xp" ) or 0 local level = getElementData ( source, "level" ) local nextXP = 50*level setElementData ( source, "xp", currXP + finalXP ) if currXP+finalXP > nextXP then setElementData ( source, "xp", 0 ) setElementData ( source, "level", level + 1 ) outputChatBox ("Rank up"..tostring(level+1), source, 255, 25, 0, true)) end end give xp use: givePlayerXP (killer,10) Client: local level = getElementData ( localPlayer, "level" ) local xp = getElementData ( localPlayer, "xp" ) dxDrawText ("Level: "..level, 15, y-50, 200, y, tocolor ( 100, 255, 100, 200 ), 1.1, "default-bold" ) dxDrawText ("XP: "..xp.."/"..tostring(level*50), 15, y-25, 200, y, tocolor ( 100, 255, 100, 200 ), 1.02, "default-bold" ) I wore it once, do not remember the author's name only remember who posted on a Russian forum
-
eae galera beleza, Eu criei um ped em função "client" e usei triggerServerEvent para usar giveWeapon que aceita somente função "server" só que não está ocorrendo o giveWeapon: código cliente: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() ped = createPed(19,1085.2349853516,-57.379425048828,81.942779541016,360) triggerServerEvent("weapPed",localPlayer,ped) end) código server: function weapPed(pedSurvivor) giveWeapon( pedSurvivor, 27, 10, true ) outputChatBox("test") end addEvent("weapPed", true) addEventHandler("weapPed", getRootElement(), weapPed) addCommandHandler ( "a", weapPed ) OBS: eu adicionei um addCommandHandler para poder testar e o outputChatBox("test") funciona só que o ped não recebe a arma :c o que pode ser? https://wiki.multitheftauto.com/wiki/GiveWeapon
-
create a attachElementToBone when equip the m4, leaves the invisible m4 not bugar with the skin you created a attachElementToBone also use onPlayerWeaponSwitch for hand gun use detachElementFromBone disappear for it whatever sorry my english elementWeaponReplace = {} function weaponReplace ( ) weapon = getPedWeapon( getLocalPlayer()) local x,y,z = getElementPosition(source) if weapon == 31 then elementWeaponReplace[source] = createObject(1943,x,y,z) setObjectScale(elementWeaponReplace[source],0.875) end exports.bone_attach:attachElementToBone(elementWeaponReplace[source],source,12,0,0,0,180,90,180) addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponReplace ) i don't know Download Bone_Attach: https://forum.multitheftauto.com/viewtopic.php?f=91&t=44088
-
First choice objects as a minigun and support then create attachs to stay in the car and sequence as createWeapon ... Continue: press the 1 button inside the car and you will see a minigun function upgradeTheCar() local veh = getPedOccupiedVehicle ( localPlayer ) local x,y,z = getElementPosition(veh) local Gunner = createObject ( 362, x, y, z) local pedestal = createObject ( 336, x, y, z) attachElements ( pedestal, veh, x, y, z, 0, 0, 0) attachElements ( Gunner, pedestal, 0, -0.3, 0.9, 0, 30, 60) end bindKey ( "1", "down", upgradeTheCar )
-
function playerZoom (key,keyState) local screenW, screenH = guiGetScreenSize() if (key == "n") then if (getElementData(getLocalPlayer(),"Night Vision Goggles") > 0) then if nightvision then nightvision = false setPedAnimation(getLocalPlayer()) setCameraGoggleEffect("normal") removeEventHandler("onClientRender", root, image) else nightvision = true addEventHandler("onClientRender", root, image) setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) setTimer(setCameraGoggleEffect, 700, 1, "nightvision") end end elseif (key == "i") then if (getElementData(getLocalPlayer(),"Infrared Goggles") > 0) then if infaredvision then infaredvision = false setPedAnimation(getLocalPlayer()) setCameraGoggleEffect("normal") removeEventHandler("onClientRender", root, image) else infaredvision = true addEventHandler("onClientRender", root, image) setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) setTimer(setCameraGoggleEffect, 700, 1, "thermalvision") end end end end bindKey("n","down",playerZoom) bindKey("i","up",playerZoom) function image() dxDrawImage(screenW *0, screenH *0, screenW *1, screenH * 1, "nightvision.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end