
cheez3d
Members-
Posts
290 -
Joined
-
Last visited
Everything posted by cheez3d
-
local cooldown = 5 -- the amount of time after the attack combo resets if no damage is detected anymore local timer = false addEventHandler("onPlayerDamage",root,function(attacker,weapon) if getTeamName(getPlayerTeam(attacker)) == "Police" and weapon == 3 and getPlayerWantedLevel(source)>=1 then if timer then resetTimer(timer) end setElementData(source,"times_attacked",getElementData(source,"times_attacked") and ,getElementData(source,"times_attacked")+1 or 1) if not timer then timer = setTimer(function() if getElementData(source,"times_attacked") then removeElementData(source,"times_attacked") end end,cooldown*1000,1) end if getElementData(source,"times_attacked")>=3 then if getElementData(source,"times_attacked") then removeElementData(source,"times_attacked") end if timer then killTimer(timer) timer = false end -- your stuff here end end end)
-
addEventHandler("onPlayerDamage",root,function(attacker,weapon) if getTeamName(getPlayerTeam(attacker)) == "Police" and weapon == 3 and getPlayerWantedLevel(source)>=1 then -- your stuff here end end)
-
addEventHandler("onMarkerHit",--[[marker]],function(player) if getAccountData(player,"job") then -- player has a job else -- player doesn't have a job end end
-
-- serverside code local showPanel = function() triggerClientEvent("onPlayerRequestPanel",player) end addEventHandler("onPlayerLogin",root,function() bindKey(source,"m","down",showPanel,source) end) addEventHandler("onPlayerLogout",root,function() unbindKey(source,"m","down",showPanel) end) -- clientside code addEvent("onPlayerRequestPanel",true) addEventHandler("onPlayerRequestPanel",resourceRoot,function() -- your panel function here end)
-
Of course you do have to make a function.
-
You are telling them to create a script called server.lua but the meta.xml has script.lua. Modify that .
-
"onPlayerLogin" "onPlayerLogout"
-
You forgot a pharanthesis at the end. addEvent("onPlayerPickUpRacePickup",true)
-
You can use getPedOccupiedVehicle().
-
https://wiki.multitheftauto.com/wiki/On ... aterCannon https://wiki.multitheftauto.com/wiki/On ... aterCannon Maybe this is triggered when the water reaches the player inside a vehicle? Then you can get the player's vehicle and do your stuff.
-
local k = "space" -- the key that turns on/off the engine local t = 3 -- how many seconds to hold the key local function toggle_engine_state(key,state) if key == k and state then local tick = getTickCount() local function check_key() if not getKeyState(key) then removeEventHandler("onClientRender",root,check_key) end if getTickCount()>=tick+t*1000 then removeEventHandler("onClientRender",root,check_key) local vehicle = getPedOccupiedVehicle(localPlayer) setVehicleEngineState(vehicle,not getVehicleEngineState(vehicle)) end end addEventHandler("onClientRender",root,check_key) end end addEventHandler("onClientVehicleEnter",root,function(player,seat) if player and seat == 0 then addEventHandler("onClientKey",root,toggle_engine_state) end end) addEventHandler("onClientVehicleStartExit",root,function(player,seat) if player and seat == 0 then removeEventHandler("onClientKey",root,toggle_engine_state) end end)
-
Little typo: health NUM B ERIC
-
Why are you looping through a table everytime a player reaches a pickup? That's highly inefficient. I would do it like this. local hunter_reach = function() if getElementData(source,"hunter.reach") then return else outputChatBox("Someone reached hunter!",root,255,255,255,true) setElementData(source,"hunter.reach",true) if getAccountPlayer(source) then setAccountData(source,"Hunters",getAccountData(source,"Hunters",getAccountData(source,"Hunters")+1) end end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",--[[your pickup element here (there is no need to attach it to the root element as it will decrease performance)]],hunter_reach) This also fixes the problem you mentioned above.
-
You can use addEvent, addEventHandler and triggerEvent. EXAMPLE: local map = { info = {name = "Map",author = "Someone"} } map.creation_handler = function() createObject(...) createObject(...) triggerEvent("onMapLoad",resourceRoot,map.info.name,map.info.author) end addEvent("onMapLoad",true) addEventHandler("onMapLoad",resourceRoot,function(name,author) -- your stuff end) -- and to create the map you call the creation_handler function map.creation_handler()
-
Lua este un substantiv, nu o abreviere. Se scrie Lua, nu LUA.
-
There is no "account" type. Use getAccounts()
-
Didn't notice I forgot a pharanthesis at the end . Thank you.
-
addEventHandler("onMarkerHit",createMarker(1726.7969970703, -3491.5029296875, 20.170000076294,"cylinder",2,187,5,175,170),function(element) -- the event "onMarkerHit" has 2 parameters of which one is the element that hit the marker if getElementType(element) == "player" then -- we check if the element is a player if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(element)),aclGetGroup("Admin")) then -- we check if the player is an admin -- your stuff else outputChatBox("You're not an admin!",element) -- player isn't an admin end end end
-
You are giving the wrong path for the images and Phone_Image returns false. Modify your paths. Also, why are you specifying true after the gui element here - guiGetVisible(Phone_Image,true). Read the wiki first.
-
addEventHandler("onResourceStart",resourceRoot,function() local marker = createMarker(2252.941,-1699.663,13.75506,"cylinder",2,0,0,0,255) outputChatBox ("The marker was spawning! Location : Los Santos , Ganton ( near LS Gym )",root,0,0,255,true ) addEventHandler("onMarkerHit",marker,function(element,dimension) if getElementType(element) == "player" then destroyElement(source) givePlayerMoney(element,10000) end end) end)
-
local window = guiCreateWindow(0,0,600,350,"bindKey Test",false) local showWindow = function() guiSetVisible(window,not guiGetVisible(window)) showCursor(not isCursorShowing()) end bindKey("p","down",showWindow)
-
That function uses an object for the movement. I suggest you to use interpolateBetween.
-
Just remove those calculations (first 2 lines) and it should stay at the same position.