Jump to content

goofie88

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by goofie88

  1. hello i have a problem on restricting a vehicle on player level =( hydra = createVehicle ( 520, 1526.5999755859, 2877.1000976563, 13.89999961853, 0, 0, 90 ) function hydralock(player, seat, jacked) local level = tonumber ( getElementData ( player, "level" ) or 0 ) if (source == hydra) then if (seat == 0) then if (level <= 7) then cancelEvent() outputChatBox ( "To enter this hydra you need to be level 7 and higher", player, 255, 0, 0, true ) end end end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), hydralock ) what did i do wrong? all level can enter it and no output =(
  2. ah I fixed the Timer but I have a new problem, when i do /flood-stop the water goes instantly down not slowly /debugscript 3 - no errors local level = 0 local left = 5000 function floodSA(source,command,speed) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin"))) then if (speed) then outputChatBox ("Flood will start in 5 sec") if (isTimer(waterTimer)) then killTimer(waterTimer) destroyElement(floodWater) setWaterLevel(0) level = 0 outputDebugString ("Previous flooding has been stopped by the server.") end setTimer ( function () local speed = tonumber(speed) floodWater = createWater(-2998,-2998,0,2998,-2998,0,-2998,2998,0,2998,2998,0) outputChatBox("--------------------------------",getRootElement(),255,0,0) outputChatBox("ALERT: A FLOOD IS EMERGING! FIND HIGH GROUND!!!",getRootElement(),255,0,0) outputChatBox("--------------------------------",getRootElement(),255,0,0) waterTimer = setTimer(addSomeWater,100,0,speed) outputDebugString("Flooding started by "..getPlayerName (source).." at a speed of "..speed..".") end ,left, 1) else outputChatBox("You must specify a speed.",source,255,0,0) end else outputChatBox ("You must be an admin to use this command!",source,255,0,0) end end addCommandHandler("flood",floodSA) function addSomeWater(speed) level = level+speed/100 setWaterLevel(level) end function delSomeWater () height = getWaveHeight ( floodWater ) setWaterLevel ( height - 0.1) end function stopFlood(source,command) if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin"))) then if (isTimer(waterTimer)) then killTimer(waterTimer) -- destroyElement(floodWater) waterDown = setTimer(delSomeWater,100,0) outputDebugString("Flooding stopped by "..getPlayerName(source)..".") outputChatBox("THE FLOOD HAS PASSED, RETURN TO YOUR HOMES!",getRootElement(),255,0,0) else outputChatBox("There is no flood to stop.",source,255,0,0) end end end addCommandHandler("flood-stop",stopFlood) function resetWater() setWaterLevel(0) end addEventHandler("onResourceStop",getResourceRootElement(getThisResource()),resetWater)
  3. It writes "Water flood will start in 5 seconds!" and "ALERT: A FLOOD IS EMERGING! FIND A HIGH GROUND!!!" then it makes the water higher and stops
  4. none of these scripts works
  5. Thank you Renkon there are no more errors but it doesnt call the flood
  6. local level = 0 function floodSA(source,command,speed) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin"))) then if (speed) then if (isTimer(waterTimer)) then killTimer(waterTimer) destroyElement(floodWater) setWaterLevel(0) level = 0 outputDebugString ("Previous flooding has been stopped by the server.") end local speed = tonumber(speed) floodWater = createWater(-2998,-2998,0,2998,-2998,0,-2998,2998,0,2998,2998,0) outputChatBox("--------------------------------",getRootElement(),255,0,0) outputChatBox("ALERT: A FLOOD IS EMERGING! FIND HIGH GROUND!!!",getRootElement(),255,0,0) outputChatBox("--------------------------------",getRootElement(),255,0,0) waterTimer = setTimer(addSomeWater,100,0,speed) outputDebugString("Flooding started by "..getPlayerName (source).." at a speed of "..speed..".") else outputChatBox("You must specify a speed.",source,255,0,0) end else outputChatBox ("You must be an admin to use this command!",source,255,0,0) end end function floodCd () setTimer ( floodSA() outputChatBox ( "Flood will start in 5 sec" ) end, 5000, 1 ) addCommandHandler("flood",floodCd) [2012-11-17 18:58:32] WARNING: Loading script failed: flood\flood.lua:30: ')' expected (to close '(' at line 29) near 'outputChatBox' Why doesnt it work? Seems theres no error for me
  7. hello sorry for bump but I have a problem with teamkill when used with medic, seems friendlyfire disabled any hit and now you cant heal with flowers here's medic script Client function stopDamage ( theplayer , attacker, weapon, bodypart ) cancelEvent() end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) Server function heal (attacker, attackerweapon, bodypart, loss) hp = getElementHealth (source) if (attackerweapon == 14) and (loss > 1) and ( hp < 99 ) then setElementHealth ( source, hp + 15 ) end end addEventHandler ("onPlayerDamage", getRootElement(), heal ) and how to make friendlyfire for 2 teams, exemple if team A shoot team B then no damage
  8. no not record like movie but, record like 20 players online and it saying in chatbox Your server made a record of 20 players and so on pls help me, I like when ppl help me
  9. Hello me wanted to make a player record script but, I have no clue how and what functions to use please could you help me
  10. but I still have a problem People can kill with helis (exemple: seasparrow) please could you help me and they can destroy my car
  11. thank you very much, works!
  12. hello I wanted to make an anti-team kill but it's not working function team ( attacker, weapon, bodypart, loss ) local attacker = getPlayerTeam ( source ) local victim = getPlayerTeam ( attacker ) if ( attacker == victim) then cancelEvent () end end addEventHandler ( "onPlayerDamage", getRootElement (), team )
×
×
  • Create New...