
karlis
Members-
Posts
1,314 -
Joined
-
Last visited
Everything posted by karlis
-
until 1.2, this is in my to-make resource list.
-
o.0 never worked for me
-
im sure lowercase doesn't work with /bind. afaik bindKey is same as /bind
-
you are one that would definitely need it a lot... if it would work properly, that would be good idea, but always someone will abuse it.
-
ye i had that idea already... probably just server settings will have option to enable it, url for stream, and path for icon.
-
"l" is improper keybind, use "L"
-
problem is that you don't actually call the ids, but just keys for the id's. so instead of getting id 602 for example you get id 1. also you dont need math.max or math.min, those functions just return max/min value passed, so its a waste with 1 argument. fix: function setRandomVehicle(theVehicle) setElementModel(theVehicle, vehicleIDS[math.random(#vehicleIDS)]) end
-
velocity works for peds and vehicles only. and basically you need to check onClientRender how close you are to target, and set velocity smaller when getting close and velocity*161=kph
-
jaysds you are such a post whore... i think he just means that for example in race gamemode, 1race stopped, other started. you just need to type "start mapcycler" in server console for that.
-
the class stuff is just lua highlighter bug, theres no errors like that in original poster side.
-
the diff is that the guy had buttons also this way and neat looking, not like just background...
-
ok, from where is the background stolen this time...
-
local theObj,time,sx,sy,fx,fy,a,b,c,ticks function handleMove() if ticks==0 then ticks=getTickCount() end local progress=(getTickCount()-ticks)/time if progress<1 then local cdist=((fx-sx)^2+(fy-sy)^2)^0.5 local cx,cy=sx+(fx-sx)*progress,sy+(fy-sy)*progress local h=a*(-cdist/2+cdist*progress)^2+b*(-cdist/2+cdist*progress)+c setElementPosition(theObj,cx,cy,h) else killHandler() end end function addParabolicMovement(theObj2,time2,sx2,sy2,fx2,fy2,a2,b2,c2) theObj,time,sx,sy,fx,fy,a,b,c,ticks=theObj2,time2,sx2,sy2,fx2,fy2,a2,b2,c2,0 addEventHandler("onClientRender",getRootElement(),handleMove) end function killHandler() removeEventHandler("onClientRender",getRootElement(),handleMove) end function addParabolicMovement(element obj, int time, float sx, float sy, float fx, float fy, float a, float b, float c) --[[ obj - no comments time - elapsing time, in ms sx,sy - starting pos fx,fy - end pos a,b,c - params for y=ax^2+bx+c function, c is base height aswell ]] note: if you want that obj ends up in same height as it started, make sure b is 0 EDIT:centered the func.
-
whats the point of calling the rgb out of loop too? and you forgot to define chat_range P.S. - i dont use lua tags cuz the broken getPlayerTeam() lcoal chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","U") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","u") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then local r,g,b = getTeamColor(getPlayerTeam(player)) or getPlayerNametagColor(player) outputChatBox("[Local Chat]".. rgbToHex(r,g,b)..nick..": #ffffff"..msg,v,0,180,0,true) end end end addCommandHandler("U",onChat) function rgbToHex ( nR, nG, nB ) local sColor = "#" nR = string.format ( "%X", nR ) sColor = sColor .. ( ( string.len ( nR ) == 1 ) and ( "0" .. nR ) or nR ) nG = string.format ( "%X", nG ) sColor = sColor .. ( ( string.len ( nG ) == 1 ) and ( "0" .. nG ) or nG ) nB = string.format ( "%X", nB ) sColor = sColor .. ( ( string.len ( nB ) == 1 ) and ( "0" .. nB ) or nB ) return sColor end
-
for example when we want something to be located in center of screen we use sx,sy=guiGetScreenSize() x,y=0.5*sx,0.5*sy just get screen size, and then multiply it by float between 0 and 1
-
do you have vehicle on map start?i doubt.
-
thanks for the support everyone! lately i have much other stuff to do and can't script that much, so don't expect release very soon(sorry for that). what i still have to do before i plan first release is to make weapon icons, money, wanted stars, ammo, time, and few other stuff(don't expect settings gui and radar areas to be in 1st release). probably i'm going to wait until 1.1, so i can disable original radio and wanted star hud, and finally add blip streaming.
-
correction: distance=( (x1-x2)^2 + (y1-y2)^2 + (z1+z2)^2 )^0.5 ) also that the 3rd z value can be added i figured logically(although im sure its documented somewhere too) imagine, you get the hypotenuse of the x and y, so u get 2D distance.then you get height(Z value), and make the distance in 2D to be one of the short triangle edge, and height the second. obliviously you will get 3D distance as result in repeated Pythagoras theorem. so this is what we came up with: distance=( (((x1-x2)^2 + (y1-y2)^2)^0.5)^2 + (z1+z2)^2 )^0.5 ) now we can shorten it: distance=( (x1-x2)^2 + (y1-y2)^2 + (z1+z2)^2 )^0.5 )
-
Actually it's . both works.
-
the sum of two short ledges distance squares equals to the sum of biggest ledge square, if triangle has a 1 90degree corner, thats Pythagoras(dunno how it spells right) theorem. in this case we consider the short ledges to be the x and y offset, and the long ledge to be the distance between points.
-
if your not lazy, you can check there https://wiki.multitheftauto.com/wiki/Animations if there isn't it, wait for 1.1 and then use https://wiki.multitheftauto.com/wiki/EngineLoadIFP https://wiki.multitheftauto.com/wiki/EngineUnloadIFP (actually i have no idea why is it removed from wiki function list)
-
it would be most effective and recommended to put guiGetScreenSize() at front of any clientside script with dx/gui functions, so you don't have to call twice.
-
1)you were overwritten source parameter by old account parameter. 2)source doesn't exist outside the function. 3)this long elseif expression is very bad way to script. 4)the account variable is already a parameter, you don't need to get account. local memberTeam = createTeam("Member", 0, 255, 0) local vipTeam = createTeam("V.I.P.", 0, 255, 255) local memberGroups={"Admin","Moderator","Member","Scripter"} function setTeams(_,account) objName='user.'..getAccountName( account ) if isObjectInACLGroup( objName, aclGetGroup( 'V.I.P.' ) ) then setPlayerTeam1(source,vipTeam) else for _,v in ipairs(memberGroups) do if isObjectInACLGroup( objName,aclGetGroup(v)) then setPlayerTeam1(source,memberTeam) end end end outputChatBox("You have successfully logged in.", source, 255, 0, 0) end addEventHandler("onPlayerLogin", getRootElement(), setTeams) when running the file remove the "1" from setPlayerTeam
-
unneeded copies without even a desc. https://community.multitheftauto.com/ind ... ls&id=2303 https://community.multitheftauto.com/ind ... ls&id=2302 https://community.multitheftauto.com/ind ... ls&id=2301