
1LoL1
Members-
Posts
944 -
Joined
-
Last visited
Everything posted by 1LoL1
-
This is full code. function ttt (player,action) if (action == "mute") then setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1) end end
-
Hello please can anyone fix this? i don't know why this not working. 0 errors 0 warnings function ttt (player,action) if (action == "mute") then setElementData(player, "ttt", (getElementData(player, "ttt") or 0) + 1) end end
-
No but thanks and my problem is solved. I used this and work. local pickup = createPickup(x,y,z,3,id,5000) function gift (thePlayer) test end addEventHandler ( "onPickupHit", pickup, gift )
-
Hello can anyone help me with my code please? how i can pickup respawn for 5 seconds? local pickup = createPickup(x,y,z,3,id,3) function gift (thePlayer) test end addEventHandler ( "onPickupUse", pickup, gift )
-
Why create unnecessary the same? Here
-
Post the line or function of this script.
-
Try this: local ammoData,weapID = getWeaponAmmoType (weaponName) if getElementData(source,ammoData) <= 0 then triggerClientEvent (source, "displayClientInfo", source,"Rearm",shownInfos["nomag"],255,22,0) return end setElementData(source,"currentweapon_"..slot,weaponName)
-
Anytime And why this not work? please can anyone help me? function xxx () local bot = createElement("bot") local cash = (getElementData(bot, "cash") or 0) outputChatBox("BOT have "..cash.."$ !", getRootElement(), 255, 0, 0, true) end addCommandHandler("xxx", xxx) function xx () local bot2 = createElement("bot") setElementData(bot2, "cash", (getElementData(bot2, "cash") or 0) + 5000) outputChatBox("BOT +5000$ !", getRootElement(), 255, 0, 0, true) end addCommandHandler("xx", xx)
-
idk how this work but use "local =" if i'am wrong sorry.
-
Try this: local newFont = dxCreateFont( "font/font.ttf", 15 ) local newFont2 = dxCreateFont( "font/font.ttf", 9 ) local newFont3 = dxCreateFont( "font/font.ttf", 24 ) local LOCAL_PLAYER = getLocalPlayer() pos = getElementPosition(LOCAL_PLAYER) showPlayerHudComponent("radar",true) showPlayerHudComponent("weapon", false ) showPlayerHudComponent( "ammo", false ) showPlayerHudComponent("vehicle_name", false ) function dxtest() local playerX, playerY, playerZ = getElementPosition( LOCAL_PLAYER ) -- Get player's coordinates. local playerZoneName = getZoneName( playerX, playerY, playerZ ) local health = string.format("%03d", (getElementHealth(LOCAL_PLAYER))) local armor = math.floor (getPedArmor(LOCAL_PLAYER)) local weaponId = getPedWeapon(getLocalPlayer()) local money = getPlayerMoney(LOCAL_PLAYER); local totalAmmo = getPedTotalAmmo(LOCAL_PLAYER); local ammoInClip = getPedAmmoInClip(LOCAL_PLAYER); local oxygen = math.floor (getPedOxygenLevel(LOCAL_PLAYER)) / 10; local stat = getPedStat(LOCAL_PLAYER,24) local time = getRealTime() local hr,mins = getTime() local time3 = hr..":"..(((mins <10) and "0"..mins) or mins) local hours = time.hour local minutes = time.minute local sWidth,sHeight = guiGetScreenSize() dxDrawImage((740/1024)*sWidth, (8/768)*sHeight, (283/1024)*sWidth, (120/768)*sHeight, "outras/background.png",0,0,0,tocolor(0,0,0,255)) dxDrawImage((868/1024)*sWidth, (60/768)*sHeight, (148/1024)*sWidth, (38/768)*sHeight, "outras/background.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((873/1024)*sWidth, (63/768)*sHeight, (22/1024)*sWidth, (33/768)*sHeight, "outras/$.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((765/1024)*sWidth, (25/768)*sHeight, (85/1024)*sWidth, (85/768)*sHeight, "img/".. tostring(weaponId) ..".png") if totalAmmo ~= false and ammoInClip ~= false then dxDrawText(tostring(ammoInClip) .. ":" .. tostring(totalAmmo),(830/1024)*sWidth, (100/768)*sHeight, (20/1024)*sWidth, (20/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) end ---dxDrawText(tostring (money),(895/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false) local moneycount = getPlayerMoney(getLocalPlayer()) local money = ' ' ..moneycount -- Money dxDrawText(tostring (money),(886/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false) dxDrawText("SAEG:RPG",(910/1024)*sWidth, (98/768)*sHeight, (310/1024)*sWidth, (135/768)*sHeight, tocolor(0,102,0,255), (sWidth/1000)*1.25, newFont2,"left","top",false,false,false) --dxDrawText("000",(900/1024)*sWidth, (13/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,150), (sWidth/1024)*0.90, newFont3,"left","top",false,false,false) dxDrawText(tostring (armor).." %",(875/1024)*sWidth, (24/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) dxDrawImage((845.7/1024)*sWidth, (24/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png") dxDrawText(tostring (health).." %",(950/1024)*sWidth, (19/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) dxDrawImage((920.7/1024)*sWidth, (19/768)*sHeight, (30/1024)*sWidth, (30/768)*sHeight, "outras/HP.png") if oxygen ~= false and isElementInWater(LOCAL_PLAYER) == true then dxDrawText(tostring(oxygen).." %",(800/1024)*sWidth, (120/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) dxDrawImage((755.7/1024)*sWidth, (125/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png", nil, nil, tocolor(0, 128, 0, 255)); end --dxDrawText(tostring (armor).." %",(906/1024)*sWidth, (73/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.90, "pricedown","left","top",false,false,false) --dxDrawText(time3,(875/1024)*sWidth, (30/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,0,255), (sWidth/1024)*1.20, "pricedown","left","top",false,false,false) --dxDrawText("r$: "..money,(800/1024)*sWidth, (140/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(34,178,170,255), (sWidth/1024)*1.10, "pricedown","left","top",false,false,false) end addEventHandler("onClientHUDRender",getRootElement(), dxtest) root = getResourceRootElement() function changeit() showPlayerHudComponent("money",false) showPlayerHudComponent("area_name",false) showPlayerHudComponent("health",false) showPlayerHudComponent("clock",false) showPlayerHudComponent("armour",false) showPlayerHudComponent("breath",false) end addEventHandler("onClientResourceStart",root, changeit) function wasted() showPlayerHudComponent("money",false) showPlayerHudComponent("area_name",false) showPlayerHudComponent("health",false) showPlayerHudComponent("clock",false) showPlayerHudComponent("armour",false) showPlayerHudComponent("breath",false) end addEventHandler("onPlayerWasted",root, wasted) function inCar() triggerEvent("onEnter",getLocalPlayer(),inCar) end addEventHandler("onClientVehicleEnter",getRootElement(),inCar) function outOfCar() removeEventHandler("onEnter",getLocalPlayer(),outOfCar) end addEventHandler("onClientVehicleExit",getRootElement(),outOfCar) function carHealth() local sWidth,sHeight = guiGetScreenSize() if isPedInVehicle(getLocalPlayer()) then vehicle = getPedOccupiedVehicle(getLocalPlayer()) health = math.ceil(getElementHealth(vehicle) / 10) speedx, speedy, speedz = getElementVelocity ( vehicle) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = math.ceil(actualspeed * 180) end end addEvent("onEnter",true) addEventHandler("onEnter",getRootElement(),carHealth) addEventHandler("onClientHUDRender",getRootElement(),carHealth) if fileExists("client.lua") then fileDelete("client.lua") end
-
Ye but "LOL" is name name LOL == "Serial" = KICK name Lol == "Serial" = Don't kick
-
Hello, how i can create script when anyone have nick "LOL" in "Serial" Example LOL == "CCCCCCCCCCCCCCCCCCCCC" if anyone have serial WWWWWWWWWWWWW he will kicked.
-
Wrong section create or move Here.
-
But i don't mean bot system. and now i fixed what i want thx for help
-
and when i want to create "bot" and give him $$$ and take from him $$$? what i must use?
-
not work. 11: Bad argument @ "setElementData" [Expected element at argument 1, got boolean] 11: Bad argument @ "getElementData" [Expected element at argument 1, got boolean] 10: Bad argument @ "getElementType" [Expected element at argument 1, got string "bot"]
-
Hello, i created this code but not work can anyone help me? function cash () local bot = getElementType("bot") local cash = (getElementData(bot, "cash") or 0) outputChatBox("BOT have "..cash.."$ !", getRootElement(), 255, 0, 0, true) end addCommandHandler("xxx", cash) function cash2 () local bot2 = getElementType("bot") setElementData(bot2, "cash", (getElementData(bot2, "cash") or 0) + 5000) outputChatBox("BOT +5000$ !", getRootElement(), 255, 0, 0, true) end addCommandHandler("xx", cash2)
-
Try this: function outputChange(dataName,oldValue) if getElementType(source) == "player" and dataName == "blood" then local newValue = getElementData(source,dataName) if newValue-oldValue < 0 then local time = getRealTime() setElementData ( source, "attacked", time.timestamp ) local timers = getTimers ( 999 ) -- Loop through the timer list for timerKey, timerValue in ipairs(timers) do -- kill the timer killTimer ( timerValue ) end setTimer ( delay1, 50, 1, "" ) end end end addEventHandler("onElementDataChange",getRootElement(),outputChange) function antiQuitPlayer ( quitType ) if quitType == "Quit" or quitType == "Timed out" then local time = getRealTime() local leavedTime = getElementData ( source, "attacked" ) if leavedTime then if time.timestamp-leavedTime < 15 then --banPlayer ( source, false, false, true, nil, nil, 3600 ) local playerAccount = getPlayerAccount(source) if (playerAccount) then setAccountData(playerAccount,'blood',-55) end end end end end addEventHandler ( "onPlayerQuit", getRootElement(), antiQuitPlayer ) function delay1 (source) outputChatBox ( "Antirelog: 15 seconds left",source,255,69,0) setTimer ( delay2, 1000, 1, "" ) end function delay2 (source) outputChatBox ( "Antirelog: 14 seconds left",source,255,69,0) setTimer ( delay3, 1000, 1, "" ) end function delay3 (source) outputChatBox ( "Antirelog: 13 seconds left",source,255,69,0) setTimer ( delay4, 1000, 1, "" ) end function delay4 (source) outputChatBox ( "Antirelog: 12 seconds left",source,255,69,0) setTimer ( delay5, 1000, 1, "" ) end function delay5 (source) outputChatBox ( "Antirelog: 11 seconds left",source,255,69,0) setTimer ( delay6, 1000, 1, "" ) end function delay6 (source) outputChatBox ( "Antirelog: 10 seconds left",source,255,69,0) setTimer ( delay7, 1000, 1, "" ) end function delay7 (source) outputChatBox ( "Antirelog: 9 seconds left",source,255,69,0) setTimer ( delay8, 1000, 1, "" ) end function delay8 (source) outputChatBox ( "Antirelog: 8 seconds left",source,255,69,0) setTimer ( delay9, 1000, 1, "" ) end function delay9 (source) outputChatBox ( "Antirelog: 7 seconds left",source,255,69,0) setTimer ( delay10, 1000, 1, "" ) end function delay10 (source) outputChatBox ( "Antirelog: 6 seconds left",source,255,69,0) setTimer ( delay11, 1000, 1, "" ) end function delay11 (source) outputChatBox ( "Antirelog: 5 seconds left",source,255,69,0) setTimer ( delay12, 1000, 1, "" ) end function delay12 (source) outputChatBox ( "Antirelog: 4 seconds left",source,255,69,0) setTimer ( delay13, 1000, 1, "" ) end function delay13 (source) outputChatBox ( "Antirelog: 3 seconds left",source,255,69,0) setTimer ( delay14, 1000, 1, "" ) end function delay14 (source) outputChatBox ( "Antirelog: 2 seconds left",source,255,69,0) setTimer ( delay15, 1000, 1, "" ) end function delay15 (source) outputChatBox ( "Antirelog: 1 seconds left",source,255,69,0) setTimer ( delay16, 1000, 1, "" ) end function delay16 (source) outputChatBox ( "Antirelog: You can disconnect now.",source,255,69,0) end
-
ah ok but i have here error and you forgot to local loss = 15 attempt to call global "setPedArmor" (a nil value) function zombieattack ( attacker, weapon, bodypart, loss ) if (attacker) then if getElementType ( attacker ) == "ped" then if (getElementData (attacker, "zombie") == true) then local playerHealth = getElementHealth ( getLocalPlayer() ) local playerArmor = getPedArmor ( getLocalPlayer() ) if playerArmor > 0 then local loss = 15 setPedArmor ( source, playerArmor - loss ) elseif playerArmor == 0 then local loss = 15 setElementHealth ( source, playerHealth - loss ) elseif playerHealth > 15 then setElementHealth ( source, playerHealth - 15 ) else triggerServerEvent ("playereaten", source, source, attacker, weapon, bodypart ) end end end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), zombieattack )
-
Hello, please how i can when zombies attacking me so first will armour down and next health. Now its when i have armour and health 100% and zombies attacked me so zombies taked me only health. function zombieattack ( attacker, weapon, bodypart ) if (attacker) then if getElementType ( attacker ) == "ped" then if (getElementData (attacker, "zombie") == true) then local playerHealth = getElementHealth ( getLocalPlayer() ) if playerHealth > 15 then setElementHealth ( source, playerHealth - 15 ) else triggerServerEvent ("playereaten", source, source, attacker, weapon, bodypart ) end end end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), zombieattack )
-
ah yes i must use set to 0 so thanks.