Timiimit
Members-
Posts
142 -
Joined
-
Last visited
Everything posted by Timiimit
-
Ok!?? this is what I have: function consoleShowMarker ( thePlayer, commandName ) if ( thePlayer ) then local theMarker = createMarker (X, Y, Z, "cylinder", 1.5, 255, 0, 0, 170 ) if ( theMarker ) then setTimer (destroyElement, 3000, 1, theMarker ) end end end function teleportPlayerIfModSmodOrAdmin ( thePlayer ) if hasObjectPermissionTo ( player, "command.kick", false ) then setElementPosition ( thePlayer,X, Y,Z ) end end addCommandHandler ( "showadminmarker", consoleShowMarker ) addEventHandler( "onMarkerHit", theMarker, MarkerHit ) it doesn't work but if I put global not local, it works even less. HELP!
-
WORKS! + what is "global" and what is "local"? (i dont know differance)
-
I forgot to put in cordinates !! thx for help!
-
i would if marker show (its not???)!
-
Hi! I have started to make some teleports for admins, moderators and super moderators only. i want to make commandHandler (showadminmarker) and then if you are admin, it create marker and after 3 seconds it dessapears! if you touch it (when visible) it should teleport you! this is what I have: function consoleShowMarker ( thePlayer, commandName ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local theMarker = createMarker ( some X, some Y, some Z, "cylinder", 1.5, 255, 0, 0, 170 ) if ( theMarker ) then setTimer ( consoleUnshowMarker, 3000, 1 ) end end end function consoleUnshowMarker () destroyElement ( theMarker ) end addCommandHandler ( "showAdminMarker", consoleShowMarker ) how to continue?
-
No. i'm pretty sure it's map because download stops when says "map downloading:" and ussualy at about 300 kb. If I remove it from loadable resources it works! Also I have 2 resources which loads map one is mine and one is from https://community.multitheftauto.com/index.php?p=resources&s=details&id=707 and if I prevent any of them from starting it works.
-
Hi! I have my own server and almost everytime I ( exept for everyone else! (It works for me but only 1 time in about 50 tries)) join I get timeout message! If not then !!MAP!! downloading doesn't complete. But if I ingame in menu I Host game and choose name....it works fine. On local (LAN) server works too! I have 1.1.1 version of MTA. I figured that something is wrong with my map! If i delete it from "MTAServer.conf" it works fine! anyone knows what's wrong????
-
I don't understand how this function works or why there must be argumants. please HELP!! Now i changed script a bit. what I have: function checkVeh ( vehicle, seat, hover ) if isVehicleOnGround ( vehicle ) == false then setWorldSpecialPropertyEnabled ( "hovercars", not isWorldSpecialPropertyEnabled ( "hovercars" ) ) end end if isVehicleOnGround ( vehicle ) == false then setWorldSpecialPropertyEnabled ( "aircars", not isWorldSpecialPropertyEnabled ( "aircars" ) ) end end end addEventHandler ( "onPlayerJoin", getRootElement(), bindTheKey) function bindTheKey() vehName = getVehicleName ( vehicle ) bind("rshift", "down", checkVeh) bind("rctrl", "down", checkVeh) end it also says that in 9th line needs to be '' near 'end'.
-
Hi! i have made script but it doesn't work. it was supose to make that when you are in air and in vehicle when you press f your vehicle starts to fly and when pressed w you are able to hover on water.what i have: function makeSpecial() if isVehicleOnGround == false then if getControlState ( source, "steer_forward" ) = "down" then if isWorldSpecialPropertyEnabled ( "hovercars" ) then setWorldSpecialPropertyEnabled ( "hovercars", false ) else setWorldSpecialPropertyEnabled ( "hovercars", enabled ) end end end elseif isVehicleOnGround == false then if getControlState ( source, "enter_exit" ) = "down" then if isWorldSpecialPropertyEnabled ( "aircars" ) then setWorldSpecialPropertyEnabled ( "aircars", false ) else setWorldSpecialPropertyEnabled ( "aircars", enabled ) end end end end (i dont konw if it works) i get error: SCRIPT ERROR: myscript\special.lua:3 'then' expected near '=' thx!
-
Can't be higher???¿¿¿
-
i tried but don't know how to make it work. my script: sound = playSound ( "music.mp3", true ) setSoundVolume ( sound, 1 ) can you help?
-
how about in beta test. there was nyan cat and music went depending on player speed!
-
HI! does anyone know how to make music speed depends on speed of player?
-
thx!
-
Ok! i changed somethings and now it works! this is script that i used(you can copy it if you want it): 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 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) if isObjectInACLGroup( 'user.timiimit', aclGetGroup( 'Admin' ) ) then local vehicle = getPedOccupiedVehicle(thePlayer) if (not vehicle) then return end local rX, rY, rZ = getVehicleRotation(vehicle) local Speeds = getElementSpeed(vehicle, "mph") setElementRotation(vehicle, rX, rY, rZ + 180) local Boost = 10 -- You Can set this to 0 if You Dont Need it ! setTimer(setElementSpeed,50,1,vehicle,1,-Speeds+Boost) outputChatBox("You turned your vehicle with " .. tostring(Speeds) .. " mph", thePlayer) else outputChatBox("#FF0000you are not allowed to use this resource!!", thePlayer) end end function bindTheKey() if isObjectInACLGroup( 'user.timiimit', 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 else outputChatBox("#FF0000you are not allowed to use this resource!!", thePlayer) end end addEventHandler("onResourceStart", resourceRoot, bindTheKey) addEventHandler("onPlayerLogin", root, function() if isObjectInACLGroup( 'user.timiimit', aclGetGroup( 'Admin' ) ) then bindKey(source, "lctrl", "down", turn) else outputChatBox("#FF0000you are not allowed to use this resource!!", thePlayer) end end) i know that many things here are unnessesary but i dont mind.
-
Script does turn the car for 180 deegres. And i want to make it for admins only!
-
Hi! I have made script and i dont know how to make it that only I (Admin) would be able to use it. this is what i have: function setElementSpeed(element, unit, speed) 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 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 = getVehicleRotation(vehicle) local Speeds = getElementSpeed(vehicle, "mph") setElementRotation(vehicle, rX, rY, rZ + 180) local Boost = 0 -- You Can set this to 0 if You Dont Need it ! setTimer(setElementSpeed,50,1,vehicle,1,-Speeds+Boost outputChatBox("You turned your vehicle with " .. tostring(Speeds) .. " mph", thePlayer) end function bindTheKey() 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 addEventHandler("onResourceStart", resourceRoot, bindTheKey) addEventHandler("onPlayerJoin", root, function() bindKey(source, "lctrl", "down", turn) end)
-
i want to make when i press left ctrl players car rotates and doesnt just turnes and goes with the same speed. i want to make that cars speed is the same but in other direction (direction of car when turned).
-
it doesnt work. I dont know how to fix. + if speed== nil(probably speed doesnt changes to 0) glitch happenes!
-
No i want to make that not only car rotates. i want to make that car rotates and make oposite speed.
