itHyperoX
Members-
Posts
522 -
Joined
-
Last visited
-
Days Won
1
Everything posted by itHyperoX
-
addCommandHandler("giveweapon",function(player, weapon, ammo) if (exports.integration:isPlayerLeadAdmin(player) or exports.integration:isPlayerLeadScripter(player)) then if weapon then if tonumber(ammo) then giveWeapon(player, weapon, ammo) end end end end)
-
Hi, how can i add two table.concat into 1 function ? addCommandHandler("oxquestion",function(player, cmd, ..., ...) local questionText = table.concat({ ... }, " ") local answerText = table.concat({ ... }, " ") end) debug: "expected near ','..
-
if isElement(aa) then return false end
-
test. call(getResourceFromName("global"),"scoreboardAddColumn","VIP",1,75) function updatePlayerVIP() for _ , player in ipairs(getElementsByType("player")) do if isPlayerInACL(player, "PLATINUM VIP") then setElementData(player, "VIP", "Platinum VIP") end if isPlayerInACL(player, "RICH VIP") then setElementData(player, "VIP", "Rich VIP") end if isPlayerInACL(player, "VIP") then setElementData(player, "VIP", "Simple VIP") end if isPlayerInACL(player, "Everyone") then setElementData(player, "VIP" , "None") end end outputChatBox("Checked") end setTimer(updatePlayerVIP,50,0) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end
-
i think shader
-
function betOnPlayer(source, cmd, amount, target) if amount then iprint("Amount") if target then local targetPlayer = getPlayerFromPartialName(target) outputChatBox("The player name is "..getPlayerName(targetPlayer), source) iprint("Target found!") --- Your code here. else iprint("No target player") end else outputChatBox("/"..cmd.." [Amount] [Target]", source) end end
-
players can see only "client" side script, but you can check it. go to MTA\mods\deathmatch\resources, pick any resources, and you can see it. I think you need to compile the "shared" file too.
-
call(getResourceFromName("global"),"scoreboardAddColumn","VIP",1,75) function setRank() for _,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if isGuestAccount(account) then setElementData(player,"VIP","None") end if isPlayerInACL(player, "PLATINUM VIP") then setElementData(player,"VIP","Platinum VIP") end if isPlayerInACL(player, "RICH VIP") then setElementData(player, "VIP","Rich VIP") end if isPlayerInACL(player, "VIP") then setElementData(player, "VIP","Simple VIP") end if isPlayerInACL(player, "Everyone") then setElementData(player, "VIP","None") end end end setTimer(setRank,500,0) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end Check /debugscript 3 pls
-
What are you trying to do? local vehHealth = getElementHealth(theVehicle) if vehHealth < 1000 then ---- code here else outputChatBox("Your vehicle is not damaged") end
-
then use this local sx,sy = guiGetScreenSize() guiCreateMemo(sx/2 - 120, sy-100, 300, 80,"YourText",false)
-
client side...
-
addCommandHandler("minigun", function () if isTimer(commandTimer) then return outputChatBox("You have to wait "..math.ceil(getTimerDetails(commandTimer)/1000).." more second to use the command again.",255,255,255,true) end if getElementData(localPlayer,"Anti-minigun") == true then commandTimer = setTimer(function() end, 1000*5, 1) setElementData(localPlayer, "Anti-minigun", false) outputChatBox("Anti-minigun Disabled") else commandTimer = setTimer(function() end, 1000*5, 1) setElementData(localPlayer, "Anti-minigun", true) outputChatBox("Anti-minigun Enabled") end end)
-
That is what you wanted.
-
local sx,sy = guiGetScreenSize() guiCreateMemo(sx/2 - 120, sy-100, 300, 80,"YourText",false) Or use this https://community.multitheftauto.com/index.php?p=resources&s=details&id=141
-
addCommandHandler("minigun", function () enabled = not enabled if enabled then setElementData(localPlayer, "Anti-minigun", false) outputChatBox("Anti-minigun Disabled") else setElementData(localPlayer, "Anti-minigun", true) outputChatBox("Anti-minigun Enabled") end end) addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), function ( attacker, weapon, bodypart ) if ( weapon == 38 ) then if (getElementData(source, "Anti-minigun")) then cancelEvent() end end end) You should add a timer for using the command because off abuse.
-
local repairMarker = createMarker(2063.5, -1831.1999511719, 13, "cylinder", 2, 255, 0 ,0 ,150) local repairSecond = 5 local fixTimer = {} addEventHandler("onMarkerHit", root, function (player) if (source == repairMarker and getElementType(player) == "player") then if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getElementHealth(vehicle) < 1000 then if getPlayerMoney(player) < 200 then return outputChatBox("You dont have enough money!", player) end setElementFrozen(vehicle, true) fixTimer[player] = setTimer(function() fixVehicle(player) outputChatBox("Your vehicle is fixed", player) setElementFrozen(vehicle, false) end,1000*repairSecond,1) else outputChatBox("Your vehicle not damaged.", player) end end end end)
-
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), function (ammo, attacker, weapon, bodypart) text = getPlayerName(attacker).." killed "..getPlayerName(localPlayer).." "("..bodypart..")" outputPubgKillog(text) end) I can't get the killer name.. Whats the problem?
-
Hello, how can i make that, the script is showing me only that resource which is loaded as last? I tried addCommandHandler("refreshres",function(source) if tonumber(getElementData(source, "player.getAdminLevel")) >= 5 then local resources = getResources() for i,v in ipairs(resources) do if getResourceState(v) == "loaded" then outputChatBox("#D32F2F"..tostring(getResourceName(v)), source, 0, 255, 0, true) end end refreshResources(true) outputChatBox("Successfully refreshed.", source, 255, 255,255,true) end end) But its keep showing me the old resoruces.
-
edit: fixed thank you
-
Niiice thank you. One more thing, if isElement(atmObject["object"]) and atmObject["object"] == source then setElementFrozen(player,true) setPedAnimation(player,"BOMBER","BOM_Plant_Loop",2*600,true,true,true,false) destroyedATM = createObject(2943, atmObject.ATMPosX, atmObject.ATMPosY, atmObject.ATMPosZ, atmObject.ATMRotX, atmObject.ATMRotY, atmObject.ATMRotZ) --------- Object if player robbed 1 ATM, setTimer(function(player,theATMID) destroyElement(atmObject["object"]) local atmObject = ATMTable[theATMID] destroyedATM = createObject(2943, atmObject.ATMPosX, atmObject.ATMPosY, atmObject.ATMPosZ, atmObject.ATMRotX, atmObject.ATMRotY, atmObject.ATMRotZ) setElementFrozen(player,false ) setPedAnimation(player,false) end,2*600,1,player,i) setTimer( function( theATMID ) local atmObject = ATMTable[theATMID] atmObject["object"] = createObject(2942, atmObject.ATMPosX, atmObject.ATMPosY, atmObject.ATMPosZ, atmObject.ATMRotX, atmObject.ATMRotY, atmObject.ATMRotZ) destroyElement(destroyedATM) end,11000,1,i) break end I want to add, if player robbed 1 atm, the atm object id is changing, but player can't rob it again until the "timer" is not ending Also, how can i make that, only 1 player can click on the object ?
-
Hello. When i click on the "atm", its starting robbing another atm if is not the first. I mean when i clicked on the 3rd ATM, for some reason the player is starting robbing the first one. Whats the problem? local ATMTable = { { ATMName = "1", ATMPosX = 2160.3579101563, ATMPosY = 1685.6997070313, ATMPosZ = 10.69529914856, ATMRotX = 0, ATMRotY = 0, ATMRotZ = 90}, { ATMName = "2", ATMPosX = 2156.099609375, ATMPosY = 1677.83203125, ATMPosZ = 10.6875, ATMRotX = 0, ATMRotY = 0, ATMRotZ = 90}, { ATMName = "3", ATMPosX = 2150.6774902344, ATMPosY = 1683.7536621094, ATMPosZ = 10.8203125, ATMRotX = 0, ATMRotY = 0, ATMRotZ = 90}, } function onStart() for i = 1, #ATMTable do local atmObject = ATMTable[ i ] atmObject["object"] = createObject(2942, atmObject.ATMPosX, atmObject.ATMPosY, atmObject.ATMPosZ, atmObject.ATMRotX, atmObject.ATMRotY, atmObject.ATMRotZ) end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),onStart) playerClicked = 0 addEventHandler("onElementClicked",getRootElement(), function(button, state, player) if button == "left" and state == "down" then for i = 1, #ATMTable do local atmObject = ATMTable[ i ] if (atmObject["object"]) then if ((isElement(atmObject["object"])) and ((getElementType(player)) == "player")) then setElementFrozen(player,true) setPedAnimation(player,"BOMBER","BOM_Plant_Loop",2*30000,true,true,true,false) destroyElement(atmObject["object"]) setTimer(function(player,theShopID) local atmObject = ATMTable[theShopID] setElementFrozen(player,false ) exports.shopRob:addPlayerCashbox(player, 1) setPedAnimation(player,false) end,2*30000,1,player,i) setTimer( function( theShopID ) local atmObject = ATMTable[theShopID] atmObject["object"] = createObject(2942, theATM.ATMPosX, theATM.ATMPosY, theATM.ATMPosZ, theATM.ATMRotX, theATM.ATMRotY, theATM.ATMRotZ) end,2400000,1,i) break end end end end end)
-
if fileExists("client.lua") then fileDelete("client.lua") end Put this in your client side script, then rename the "client.lua" with your .lua name.
-
if you want you can use this: dxDrawButton("Your Text",1, 40, 30, 25, tocolor(0,0,0,135)) function dxDrawButton(text, startX, startY, width, height, color) dxDrawRectangle(startX - 1, startY, 1, height, tocolor(0,0,0,255)) --left dxDrawRectangle(startX + width, startY, 1, height, tocolor(0,0,0,255)) --right dxDrawRectangle(startX - 1, startY - 1, width + 2, 1, tocolor(0,0,0,255)) --top dxDrawRectangle(startX - 1, startY + height, width + 2, 1, tocolor(0,0,0,255)) --bottom dxDrawRectangle(startX, startY, width, height, color) dxDrawText(text, startX, startY, startX + width, startY + height, tocolor(255, 255, 255), 1, "default", "center", "center", false, false, false, true) end