
Timiimit
Members-
Posts
142 -
Joined
-
Last visited
Everything posted by Timiimit
-
is there a way to detect when someone pushed vehicle from left, right, back or from front?
-
yes, freeroam. what are type, msg? btw what is has to do with chatfilter? chatfilter changes swear words (like f*ck) into " * " char.
-
thx! Isn't there easyer way? like i would add some points and he would follow them? i would like to make something like this:
-
Hi! OK. i created a ped and vehicle and warped ped in it now how to move vehicle?
-
Hi! I've downloaded chatfilter from community and tested it but id doesnt work properly! it always outputs 2 times what u type. anyone know how to fix that? link to chatfilter: https://community.multitheftauto.com/index.php?p=resources&s=details&id=3167
-
lua: theVehicle = getPedOccupiedVehicle( source ) function rndColors() local color = {} color[1] = math.random(0,126) color[2] = math.random(0,126) color[3] = math.random(0,126) color[4] = math.random(0,126) setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) outputChatBox( "Enjoy the PARTY!", source, 0, 255, 0 ) end function makeTimer() if ( theVehicle == false ) then outputChatBox ( "Get into a vehicle first!", getRootElement(), 255, 50, 0, true ) else setTimer( rndColors, 100, 1 ) outputChatBox ( "You are in vehicle!!", getRootElement(), 255, 50, 0, true ) end end addCommandHandler(" discovehicle", makeTimer )
-
Hi! Why THE **** DO I GET AN ERROR THAT SAYS "getPedOccupiedVehcle" HAS BAD ARGUMANT theVehicle = getPedOccupiedVehicle( source )
-
dont know ill try.
-
no errors. debugscript 3: nothing like its not running!??
-
Hi! I had a script that WORKED in 1.2 but not anymore in 1.3. could you tell me what is wrong with script? here it is: function setElementSpeed(element, unit, speed) -- only work if element is moving! if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end function turn(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) if (not vehicle) then return end local rX, rY, rZ = getElementRotation(vehicle) local Speeds = getElementSpeed(vehicle, "mph") setElementRotation(vehicle, rX, rY, rZ + 180) local Boost = 3 setTimer(setElementSpeed,50,1,vehicle,1,-Speeds+Boost) outputChatBox("#00FF00You turned your vehicle with #FF0000" .. tostring(Speeds) .. " mph", thePlayer) end function bindTheKey(p) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(p)),aclGetGroup("Admin")) then for index, player in pairs(getElementsByType("player")) do bindKey(player, "lctrl", "down", turn) outputChatBox("#00FF00You can press #0000FF'left ctrl' #00FF00in vehicle to turn for 180 degrees!", player, 255, 255, 255, true) end end end addCommandHandler("turningON",bindTheKey) function unBindTheKey(p) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(p)),aclGetGroup("Admin")) then for index, player in pairs(getElementsByType("player")) do unbindKey(player, "lctrl", "down", turn) outputChatBox("#FF0000Turning disabled!", player, 255, 255, 255, true) end end end addCommandHandler("turningOFF",unBindTheKey)
-
Hi! Is it possible to make that resource (not only one script in resource) downloads every time when someone joins the server? If it is possibe then how?
-
Ok i fixed the script thx anyway!
-
thx for everithing! my finished script: sound = playSound ("nyancat.mp3", true) local function adjustSoundSpeed() --Remove this event handler is the sound is removed if not isElement(sound) then removeEventHandler("onClientRender", root, adjustSoundSpeed) return end local player = localPlayer if isPedInVehicle(player) then player = getPedOccupiedVehicle(player) end --Calculate the velocity of the local player local velX, velY, velZ = getElementVelocity(player) local velocity = (velX^2 + velY^2 + velZ^2)^(0.5) local speed = velocity / 2 -- Get the time local hour, minute = getTime ( ) -- Perform difficultz calculatus when time is involved if hour >= 0 and hour < 2 then if hour == 1 then minute = minute + 60 end local vol = 0.8 * getEasingValue ( ( 1 / 120 ) * minute, "InQuad" ) setSoundVolume ( sound, vol ) elseif hour >= 5 and hour < 7 then if hour == 6 then minute = minute + 60 end local vol = 0.8 * ( 1 - getEasingValue ( ( 1 / 120 ) * minute, "OutQuad" ) ) setSoundVolume ( sound, vol ) elseif hour >= 2 and hour < 5 then setSoundVolume ( sound, 0.8 ) else setSoundVolume ( sound, 0 ) return end --Calculate a reasonable speed velocity = velocity + 1.5 speed = velocity / 3 setSoundSpeed( sound, speed ) end addEventHandler("onClientRender", root, adjustSoundSpeed)
-
not working. errors: [2012-01-27 16:43:32] WARNING: myscripts\vehFix.lua:2: Bad 'ped' pointer @ 'getPedOccupiedVehicle'(1) [2012-01-27 16:43:32] WARNING: myscripts\vehFix.lua:4: Bad argument @ 'getElementHealth' [2012-01-27 16:43:32] ERROR: myscripts\vehFix.lua:4: attempt to perform arithmetic on a boolean value
-
Hi! i'm making today yet another topic. This one is about Fixing vehicles. So this is what i have: function vehFix ( source ) theVehicle = getVehicleOccupant ( source ) fixVehicle ( theVehicle ) end setTimer ( vehFix, 3000, 0 ) its not working! it should fix vehicle player is in every 3 sec(if you know how to make it when vehicle gets damaged please tell me).
-
ok working!!! Thx so much! I still need one more help im making topic.. name will be "Fixing help"
-
Hi! I am making a script that will lock vehicle when you enter it and press 'L' and to unlock it press 'L' again. what i have: function lockcar ( thePlayer ) playerVehicle = getVehicleOccupant ( thePlayer ) if ( playerVehicle ) then if isLocked == false then setVehicleLocked ( playerVehicle, true ) outputChatBox( "Vehicle locked!", thePlayer, 255, 50, 0) else setVehicleLocked ( playerVehicle, false ) outputChatBox( "Vehicle unlocked!", thePlayer, 0, 255, 0) end end function bindLockOnSpawn ( theSpawnpoint ) bindKey ( source, "l", "down", lockcar ) local isLocked = false end addEventHandler ( "onPlayerSpawn", getRootElement(), bindLockOnSpawn ) Please help because it is not working!
-
??? you mean it should be like this? addEventHandler ( "onClientVehicleEnter", local driver = getVehicleOccupant ( source ) if ( driver ) then addVehicleUpgrade ( theVehicle, 1010 ) setTimer( addVehicleUpgrade ( theVehicle, 1010 ), 20000, 0) end end) It's not working!