karlis
Members-
Posts
1,314 -
Joined
-
Last visited
Everything posted by karlis
-
is that 3hours of work non-publick, or u gonna put it somewhere?
-
change nick on nick change and dont get into infinite loop
karlis replied to dzek (varez)'s topic in Scripting
thats so simple if newnick~=oldnick then changenick, it will be same if u change it once and then going in loop to change it again -
ill show u example how to make white-black textdraw on center of screen --clientside! screenx,screeny = guiGetScreenSize() function maketextdraw() dxDrawText("this is ur textdraw",screenx/2-250,screeny/2-150,screenx/2+250,screeny/2+150,tocolor(0,0,0),1.05,"default-bold","center","center",false,true,false) -- make shadow dxDrawText("this is ur textdraw",screenx/2-248,screeny/2-148,screenx/2+248,screeny/2+148,tocolor(255,255,255),1,"default-bold","center","center",false,true,false) -- make text end addEventHandler("onClientRender",getRootElement(),maketextdraw)
-
so its posible to execute for example /quit or /dissconetc, or /nick, or /time, etc commands with that function? and u can clear chatbox with many times outputchatbox "", and save all chat to otput again by: --client! --chat saver chattab = {} line = 1 addEventHandler("onClientChatMessage",getRootElement(), function (text,r,g,b) if text~="" then chattab[line] = string.gsub(tocolor(tonumber(r),tonumber(g),tonumber(b)),"0x%x%x","#")..text line = line+1 end end) --chat clear function clearChat() done=0 while done<=200 do outputChatBox("",0,0,0,false) done = done+1 end end --put chat back function reAddChat() if #chattab>200 then addcount = #chattab currentcount = #chattab-200 else addcount = #chattab currentcount = 0 end while currentcount<=addcount do outputChatBox(chattab[currentcount],0,0,0,true) currentcount = currentcount+1 end end EDIT: updated with new code
-
you can also guiCreateLabel(name,x,y,sizex,sizey,text,relative) for textdraws like in samp with shadows best use onClientRender together with 2 dxDrawText, 1for shadow, then for text
-
i dotn want bumb, but im intrested how its goign with that ice?
-
isnt with executeCommandHandler posible to execute chatbox options?so server could change options to ones that server alows to.or its disabled on build in commands?
-
make it lite transparent by moding alphas
-
u sure theres no fence that fit it?anyway i think hayblocks are way too deep and in unfitable form for ice
-
how about snowy flying castle?i think it would look awesome and, if ure making snow ice would be awesome too(1dummyed smashable fence transformed into spmashable ice representing obj)
-
You mean copying server IP from MTA server browser for friends? ye that would be good feature.. not possible right now, you need to write it down manually; as for now we got not so big servers list, so just tell your friend desired server name, and he can find it easily by entering given name to the search field. 2 friends have browser broken
-
You can do that on console but would be really nice on normal chat. how?!
-
if it would be posible would be nice to sync copy/paste ingame and out of game, would rly help when need connect to some ip or export ip and show to someone
-
not sure will it work, but try getElementVelocity(moving obj) and then setElementVelocity(current vehicle)
-
and how about servers at all?can i use just connect?
-
hi, i have such an problem: i cant find any server on browser, its just empty, and yes, i unblocked mtaclient from firewall.can someone help me please?
-
posted at old topic this too, but since noone realy saw it i decided to make new one: "error downloading requested files: Couldn't resolve host name." reinstalling mta, and using default config didnt help i an enter my server, bot others get this bug please help
-
"error downloading requested files: Couldn't resolve host name."occurs again, i didnt change any configs, and its same with default config too, what could be the problem?
-
"error downloading requested files: Couldn't resolve host name."occurs again, i didnt change any configs, and its same with default config too, what could be the problem?
-
nope, it was for ''glue'', but i changed it and nothing
-
nope, it was for ''glue'', but i changed it and nothing
-
dont find any: local thePlayer = getLocalPlayer()local theStingers = {}local theColShapes = {} function bindStingerKey() bindKey( "x", "down", dropStinger ) -- bind the "x" key to the drop stinger functionend addEventHandler( "onClientResourceStart", getRootElement(), bindStingerKey )addEventHandler( "onClientPlayerJoin", getRootElement(), bindStingerKey ) function dropStinger( key, keyPress ) if( isPlayerInVehicle( thePlayer ) ) then -- is the player in a car? if( isElement( theStingers[ thePlayer ] ) ) then destroyElement( theStingers[ thePlayer ] ) destroyElement( theColShapes[ thePlayer ] ) end local theVehicle = getPlayerOccupiedVehicle( thePlayer ) -- get the player's car local x, y, z = getElementPosition( theVehicle ) -- get vehicle position local rx, ry, rz = getVehicleRotation( theVehicle ) -- get vehicle rotation local a = getPlayerRotation( thePlayer ) -- get player facing angle x = x + math.sin( math.rad(a) ) * 4 y = y - math.cos( math.rad(a) ) * 4 rz = rz + 90 local groundZ = getGroundPosition( x, y, z ) if( groundZ ~= z ) then z = groundZ + 0.2 end theStingers[ thePlayer ] = createObject( 2899, x, y, z, 0, 0, rz ) -- create the stinger (2892) theColShapes[ thePlayer ] = createColRectangle( (x - 2.0), (y - 2.0), 4.0, 4.0 ) -- set a colshape to check when a car hits the stinger setElementData( theColShapes[ thePlayer ], "amistinger", "yesplz" ) -- set the colshape as a stinger colshape --outputChatBox( "You dropped a stinger!", thePlayer, 255, 0, 0, true ) -- output a chatbox message else -- outputChatBox( "You have to be in a vehicle to drop a stinger!", thePlayer, 255, 0, 0, true ) endend function clientHitStinger( theElement, matchingDimension ) if( getElementType( theElement ) == "vehicle" and getElementData( source, "amistinger" ) == "yesplz" ) then setVehicleWheelStates( theElement, 1, 1, 1, 1 ) end -- if the element is a vehicle and the colshape is the stinger's colshape, pop the vehicles tiresend addEventHandler( "onClientColShapeHit", getRootElement(), clientHitStinger ) function destroyStinger( player, seat ) if( isElement( theStingers[ player ] ) ) then destroyElement( theStingers[ player ] ) destroyElement( theColShapes[ player ] ) endend addEventHandler( "onClientPlayerQuit", getRootElement(), destroyStinger )addEventHandler( "onClientVehicleExit", getRootElement(), destroyStinger )
-
dont find any: local thePlayer = getLocalPlayer() local theStingers = {} local theColShapes = {} function bindStingerKey() bindKey( "x", "down", dropStinger ) -- bind the "x" key to the drop stinger function end addEventHandler( "onClientResourceStart", getRootElement(), bindStingerKey ) addEventHandler( "onClientPlayerJoin", getRootElement(), bindStingerKey ) function dropStinger( key, keyPress ) if( isPlayerInVehicle( thePlayer ) ) then -- is the player in a car? if( isElement( theStingers[ thePlayer ] ) ) then destroyElement( theStingers[ thePlayer ] ) destroyElement( theColShapes[ thePlayer ] ) end local theVehicle = getPlayerOccupiedVehicle( thePlayer ) -- get the player's car local x, y, z = getElementPosition( theVehicle ) -- get vehicle position local rx, ry, rz = getVehicleRotation( theVehicle ) -- get vehicle rotation local a = getPlayerRotation( thePlayer ) -- get player facing angle x = x + math.sin( math.rad(a) ) * 4 y = y - math.cos( math.rad(a) ) * 4 rz = rz + 90 local groundZ = getGroundPosition( x, y, z ) if( groundZ ~= z ) then z = groundZ + 0.2 end theStingers[ thePlayer ] = createObject( 2899, x, y, z, 0, 0, rz ) -- create the stinger (2892) theColShapes[ thePlayer ] = createColRectangle( (x - 2.0), (y - 2.0), 4.0, 4.0 ) -- set a colshape to check when a car hits the stinger setElementData( theColShapes[ thePlayer ], "amistinger", "yesplz" ) -- set the colshape as a stinger colshape --outputChatBox( "You dropped a stinger!", thePlayer, 255, 0, 0, true ) -- output a chatbox message else -- outputChatBox( "You have to be in a vehicle to drop a stinger!", thePlayer, 255, 0, 0, true ) end end function clientHitStinger( theElement, matchingDimension ) if( getElementType( theElement ) == "vehicle" and getElementData( source, "amistinger" ) == "yesplz" ) then setVehicleWheelStates( theElement, 1, 1, 1, 1 ) end -- if the element is a vehicle and the colshape is the stinger's colshape, pop the vehicles tires end addEventHandler( "onClientColShapeHit", getRootElement(), clientHitStinger ) function destroyStinger( player, seat ) if( isElement( theStingers[ player ] ) ) then destroyElement( theStingers[ player ] ) destroyElement( theColShapes[ player ] ) end end addEventHandler( "onClientPlayerQuit", getRootElement(), destroyStinger ) addEventHandler( "onClientVehicleExit", getRootElement(), destroyStinger )
-
1) fixed, and u say i only ned change cmd name in stinger script to avoid that?
