-
Posts
1,058 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Saml1er
-
@Anubav: You don't need to use tostring if you're converting it into a number.
-
Actually when a player joins then you must get all player and check their gang and elements attached to the player, so if it is a blip then make it visible for the player that joined your server.
-
I had a zombie server in MTA 1.3. I thought I was the only one with this bug but Idk it got fixed somehow.
-
local fontSize = (2.30/sw)*sWidth dxDrawText("km/h", 1089/sw*sWidth, 844/sh*sHeight, 1215/sw*sWidth, 905/sh*sHeight, tocolor(195, 195, 195, 255), fontSize,"pricedown", "left", "top", false, false, true, false, false)
-
Dude this was in 2013.
-
Actually there is but depends on you when or how you use it. If you can do it without elemendata then it's really good but if you can't then it's ok to use it but try to use it in only extreme necessary.
-
local BlipAdd = function () addTeamBlip (source) end addEventHandler ( "onPlayerJoin", root, BlipAdd ) addEventHandler ( "onPlayerSpawn", root, BlipAdd )
-
Well depends on you but anyone who joins your server will think that if player ( criminal ) is lagging.
-
Use fetchRemote for downloading stuff. ____________________________________________________________________________________________________________ You must set download to false in meta.xml for downloadFile. "test.txt" download="false"/>
-
It can also be your acl.
-
Yes but you never know when the player gets stuck so he has to jump.
-
Yes, sorry for typo. setPedRotation (criminal , followRotation ) We are using math.random cause we also want the player to jump because sometimes the player is in water and he can't get out of it.
-
You can make another ped using createPed and kill him onPlayerWasted. Btw it's not possible for players but possible for other peds.
-
local SecondsDelayForSpawn = 1 -- 1 second function respawnExplodedVehicle() setTimer(respawnVehicle, SecondsDelayForSpawn*1000, 1, source) end addEventHandler("onVehicleExplode", root, respawnExplodedVehicle) function respawnInactiveVehicles() local vehicles = getElementsByType ("vehicle") for _, vehicle in ipairs(vehicles) do if (vehicles) then toggleVehicleRespawn(vehicle, true) setVehicleIdleRespawnDelay(vehicle, 120000) end end end addEventHandler ("onResourceStart", root, respawnInactiveVehicles
-
local a = false a = a or " " print ( type (a) ) --> string so YES!
-
1st method. local speed ,start = 4,getTickCount() addEventHandler("onClientRender", root, function() local rot = (((start - getTickCount())/1000)/60)/speed --[[ if you multiply speed with - 1 ( speed * -1 ) then the image might start rotating clockwise or anti-clockwise.]] dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) end ) 2nd method. local rot = 0 addEventHandler("onClientRender", root, function() local rot = rot + 0.1 dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) end )
-
If you use attachElements then it will simply attach the element to player. Nothing more. Criminal won't follow the cop. So to make it right, you must use setControlState This is how you're gonna use it. local function Follow(criminal,cop ) if cop and criminal and isElement ( cop ) and isElement ( criminal ) then local ax,ay,az= getElementPosition ( cop ) local jx,jy,jz = getElementPosition ( criminal ) local followRotation = ( 360 - math.deg ( math.atan2 ( ( ax- jx ), ( ay - jy ) ) ) ) % 360 setPedRotation (criminal , cop ) --- making the criminal to look at cop --- now we need to make him follow local distance = getDistanceBetweenPoints3D( ax,ay,az,jx,jy,jz ) if distance > 0.8 then local WhatToDo = math.random (1,5) if WhatToDo == 1 then setControlState ( criminal, "forwards", true) setTimer ( function (criminal) if isElement ( criminal ) then setControlState ( criminal, "forwards", false) end end, 2000, 1, criminal ) elseif WhatToDo == 3 then setControlState ( criminal, "jump", true ) setTimer ( function (criminal) if isElement ( criminal ) then setControlState ( criminal, "jump", false) end end, 2000, 1, criminal ) end end local data = getElementData(criminal,"follow" ) or false if data == true then setTimer ( Follow,3000,1,criminal,cop ) end end end --------- USAGE local criminal = --- define criminal toggleAllControls (criminal,false,false,false) --enable all controls which we disabled setElementData(criminal,"follow",true ) local cop = --- define cop Follow ( criminal, cop ) --- now call the function now once you call the function then you don't need to call it again because the timer will keep repeating, if you want to stop criminal from following the ped then use this then simply use an element data local criminal = ---- define criminal toggleAllControls (criminal,true) --- enable all controls which we disabled setElementData(criminal,"follow",nil ) -- this will stop the criminal from following the cop NOT TESTED. This is just an example.
-
He already did (even two times). See previous page. Ah, I wonder how I missed that.
-
15 $ should be maximum price but first post a video. You have to prove that script is working.
-
Tire, Engine already works but not tank parts and is even higher.. : And here's the error.. : maybe an end is missing, send me the function in pm.
-
if you don't know about environments then it's better not to use loadstring because you can't nil the variable just like that, you need to change environment using setmetatable and you don't even need to use loadstring for this + lua.org suggests that you should use pcall. local var = loadstring ("print(1)") pcall (var)
-
if ((setElementData(col,"Tire_inVehicle"), math.random (0, tonumber(tires)) then to local num = tonumber(tires) if num and setElementData(col,"Tire_inVehicle", math.random (0, num) ) then
-
You actually don't need to remove element data because once player leaves the server then element data is set to nil or simply it's lost.