Jump to content

Fuentes

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Fuentes

  1. 'safe' is not defined anywhere within 'safecheck' function please help
  2. next getelementdata problem: local groupsafe = tonumber(getElementData(safe, "group")) and mysql datatable 2 safe id 1 safeid:faction1 2 safeid:faction2 script now i faction 1 chatbox test faction 1 safe money please help thank you function safecheck() local teamID = tonumber(getElementData(source, "group")) local groupsafe = tonumber(getElementData(safe, "group")) if teamID >0 then if groupsafe == teamID then outputChatBox ("test ") else outputChatBox ("Not are factionsafe") end else outputChatBox ("Not are faction") end end addEvent("safecheck", true ) addEventHandler("safecheck", getRootElement(),safecheck)
  3. Bad argument @ 'getEleme ntData' [Expected element at argument 1, got nil]
  4. function safeLoadCallback(qh) local result, num = dbPoll(qh, 0) for k, row in ipairs(result) do local safe = createObject(2332, row["x"],row["y"],row["z"],row["interior"],row["dimension"],row["rotation"]) setElementData(safe, "dbId", row["id"]) setElementData(safe, "x", row["x"]) setElementData(safe, "y", row["y"]) setElementData(safe, "z", row["z"]) setElementData(safe, "interior", row["interior"]) setElementData(safe, "rot", row["rotation"]) setElementData(safe, "group", row["group"]) setElementData(safe, "money", row["money"]) setElementData(safe, "kokain", row["kokain"]) setElementData(safe, "heroin", row["heroin"]) setElementData(safe, "matreial", row["material"]) end end function test(player) local money = getElementData(safe, "money") outputChatBox("money: "..money,player, 255, 0, 0) end addCommandHandler("test", test, false, false) Bad argument @ 'getElementData' [Expected element at argument 1, got nil
  5. local x, y, z = hitX, hitY, hitZ local x2 = getElementData(hitElement, "x") local y2 = getElementData(hitElement, "y") local x2 = getElementData(hitElement, "x") if x2 and y2 and z2 then bad argument getelementdata
  6. Bad argument @ 'getElementData' [Expected element at argument 1, got nil] local x2 = getElementData(fire, "x") local y2 = getElementData(fire, "y") local x2 = getElementData(fire, "x")
  7. function firelost(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if (weapon==42) then local team = getPlayerTeam(getLocalPlayer()) local ftype = getElementData(getLocalPlayer(), "faction") ---outputChatBox("." ..hitX.." "..hitY.." "..hitZ, 255, 0, 0) if (ftype==4) then if not (hitElement) or (getElementType(hitElement)~="player") then -- Didn't attack someone if not cooldown then if (ammoInClip>10) and (weapon==42) then local x, y, z = hitX, hitY, hitZ local x2 = getElementData(fire, "x") local y2 = getElementData(fire, "y") local x2 = getElementData(fire, "x") if x2 and y2 and z2 then outputChatBox("Not are fire.", 255, 0, 0) count = 0 cooldown = setTimer(resetCooldown, 5000, 1, false) else count = count + 1 if (count==20) then count = 0 cooldown = setTimer(resetCooldown, 30000, 1, false) triggerServerEvent("cancelrandomfires", localPlayer) end end end end end end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(),firelost) Bad argument @ 'getElementData' [Expected element at argument 1, got nil]
  8. i dont know sorry please help scripting
  9. create fire position fX fY fZ function startTheFire (fX,fY,fZ) setElementData(fire, "x", fX) setElementData(fire, "y", fY) setElementData(fire, "z", fZ) setTimer ( function() createFire(fX,fY,fZ,60) end, 420000, 1) local Soundone = playSound3D( "files/firealarm.mp3",fX,fY,fZ, false ) setSoundMinDistance(Soundone, 25) setSoundMaxDistance(Soundone, 70) local Soundtwo = playSound3D( "files/firealarmsecond.mp3",-2039.7060546875 ,78.998046875 ,28.397680282593, false ) setSoundMinDistance(Soundtwo, 25) setSoundMaxDistance(Soundtwo, 70) --setSoundVolume( Sound, 1 ) local fire = engineLoadDFF("fire.dff",1) engineReplaceModel(fire,fireModel) end addEvent("startTheFire",true) addEventHandler( "startTheFire", getRootElement(), startTheFire) Problem: function firelost(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if (weapon==42) then local team = getPlayerTeam(getLocalPlayer()) local ftype = getElementData(getLocalPlayer(), "faction") if (ftype==4) then if not (hitElement) or (getElementType(hitElement)~="player") then if not cooldown then if (ammoInClip>10) and (weapon==42) then local x, y, z = hitX, hitY, hitZ local x2 = getElementData(fire, "x") local y2 = getElementData(fire, "y") local z2 = getElementData(fire, "z") if getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) > 10 then outputChatBox("Are not fire.", 255, 0, 0) count = 0 cooldown = setTimer(resetCooldown, 5000, 1, false) else count = count + 1 if (count==20) then count = 0 cooldown = setTimer(resetCooldown, 30000, 1, false) triggerServerEvent("cancelrandomfires", localPlayer) end end end end end end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(),firelost) error: Bad argument @ 'getDistanceBetweenPoints3D' [Expected vector3 at argument 4, got boolean] Thank You
×
×
  • Create New...