-
Posts
667 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Mr.Loki
-
createMarker onMarkerHit getElementPosition createVehicle
-
Using guiCreateBrowser is pretty simple: Upload or get a vid from youtube Get the video id from the video url Replace VIDEO_ID with the video id from youtube https://www.youtube.com/embed/VIDEO_ID?autoplay=1&controls=0&loop=1&showinfo=0 Load the browser with this url and it will play in the background
-
if getTeamName ( player ) == getTeamName( source ) then outputChatBox(..., player, ...) end I don't think you want people from other teams to be talking in the same team lol
-
setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] ) You can do this by setting the interruptable arg to false.
-
instead of using the gate to generate the col just make a rectangle surrounding the gate and use that object as the col
-
Ok and I saw that you were using playSound which plays at the same volume no matter the distance I didn't really think of it that way thx for tip lol
-
getDistanceBetweenPoints3D works just fine. playSound3D plays the sound at the location. addEvent("alarmOnSound", true) function alarmOnSound() local x,y,z = getElementPosition(source) local x2,y2,z2 = getElementPosition( localPlayer ) if getDistanceBetweenPoints3D( x,y,z,x2,y2,z2 ) <= 20 then playSound3D("lock.mp3",x,y,z) end end addEventHandler("alarmOnSound", root, alarmOnSound) --------------------------------------------------------------------------------------------------------------------------- addEvent("alarmOffSound", true) function alarmOffSound() local x,y,z = getElementPosition(source) local x2,y2,z2 = getElementPosition( localPlayer ) if getDistanceBetweenPoints3D( x,y,z,x2,y2,z2 ) <= 20 then playSound3D("unlock.mp3",x,y,z) end end addEventHandler("alarmOffSound", root, alarmOffSound)
-
Use moveObject to move stuff even smoother than render also that's a bad idea you will timeout your server because of the high bandwidth usage.
-
No prob
-
Use @koragg code and modify the /me command like this: addEventHandler ( "onPlayerChat", root, function ( msg, tp ) if ( tp == 1 ) then cancelEvent ( ) -- Add your /me code here for example: outputChatBox(getPlayerName(source)..": "..msg,root,255,255,0) end end )
-
Yes you would, but only if you set the restricted argument to false.
-
Use the code button < > to make code easily readable: addEventHandler ( "onPlayerChat", root, function( message,messageType ) if messageType == 1 then cancelEvent() end end) This code works fine for me. Are you running the code Server side?
-
Well this is the best way to learn unless you want to keep asking others for help when you can help yourself. Its all about thinking logically about how you want the script to run and a bit of trial and error which will help you understand way more. Your code above is a good start but onPlayerChat has 2 Parameters: string message, int messageType you would need to change cmd because it is in the position of the message parameter and add the message type after it function( message, messageType ) You can now use the messageType to determine if the message was a: 0: normal message 1: action message (/me) 2: team message Since you want to disable "1" which is /me aka action message you will need to check for it if messageType == 1 then now that it's an action message you want to cancel it using cancelEvent cancelEvent() and that's basically it, pretty simple right?
-
Example 1 on the wiki for onPlayerChat is perfect for what you are trying to achieve because all you have to di is remove some lines of code from it.
-
In line 5 you are checking for 2 (Force on) but you never set the lights to 2 (Force on) in the code. function toggleLights(thePlayer) if isPedInVehicle(thePlayer) then local car = getPedOccupiedVehicle(thePlayer) if getPedOccupiedVehicleSeat(thePlayer) == 0 then if getVehicleOverrideLights(car) ~= 2 then setVehicleOverrideLights(car, 2) outputChatBox(getPlayerName(thePlayer).. "has turned the lights on.", root, 255, 0, 255) else setVehicleOverrideLights(car, 1) outputChatBox(getPlayerName(thePlayer).. "has turned the lights off.", root, 255, 0, 255) end else outputChatBox("You must be on driver seat!", thePlayer, 255, 0, 0) end else outputChatBox("You must be inside a vehicle!", thePlayer, 255, 0, 0) end end addCommandHandler("lights", toggleLights)
-
an ez way just transfer everything in the db table to another table and then add them to the gridlist
-
Create a Blip that shows only to the Player who died
Mr.Loki replied to Big Smoker's topic in Scripting
This looks like DayZ. Just add this t the code. Change "source" to the player arg in the function if it isn't source. local pblip = createBlip ( x, y, z , 23, 2, 255, 255, 255, 255, 0, 99999, source) --creates the blip at the location. setTimer(destroyElement,2700000,blip) --destroys the blip when the other timer destroys Dead Player. Tip: its good to read the functions wiki and learn the arguments for functions. -
Those are not real weapons. What you are trying to do is impossible because an M240 is just an M4 with a mod. setWeaponProperty is a server sided script meaning it will change for every weapon type. For example if someone has M4 and another person has M240 they will both have 100 rounds in their clip.