-
Posts
4,121 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Kenix
-
getElementData setElementData Получаешь, прибавляешь.
-
You need use model id, not weapon id. You can see here https://wiki.multitheftauto.com/wiki/Weapons ( in column Model ID )
-
What return nil? request? Can you please tabulate code.
-
setTimer ( function( ) triggerServerEvent( "GUIwins", localPlayer ) triggerServerEvent( "GUIpoints", localPlayer ) triggerServerEvent( "GUIsecond" localPlayer ) triggerServerEvent( "GUIthird", localPlayer ) triggerServerEvent( "GUIrank", localPlayer ) end, 100, 0 ) ? I think it's bad idea.
-
Client addEvent( 'yanas', true ) local button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, 'Output!', true ) local editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, 'Type your message here!', true ) guiEditSetMaxLength( editBox, 128 ) guiSetVisible( button, false ) guiSetVisible( editBox, false ) function outputEditBox ( sText ) local text = guiGetText( editBox ) outputChatBox( sText or text ) setTimer( outputEditBox, 1000, 1 ) end addEventHandler( 'yanas', root, outputEditBox ) addEventHandler( 'onClientGUIClick', button, outputEditBox ) addEventHandler( 'onClientGUIClick', editBox, outputEditBox ) bindKey( 'F1', 'down', function( ) guiSetVisible( button, not guiGetVisible( button ) ) guiSetVisible( editBox, not guiGetVisible( editBox ) ) showCursor( not isCursorShowing( ) ) end ) Server addCommandHandler('wla', function( uPlayer ) for _, uPlayer in pairs( getElementsByType 'player' ) do local sName = getAccountName( getPlayerAccount( uPlayer ) ) if isObjectInACLGroup( 'user.' .. sName, aclGetGroup( 'Admin' ) ) then triggerClientEvent( uPlayer, 'yanas', uPlayer, 'yana' ) end end end ) Read it https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
-
getPedBonePosition getScreenFromWorldPosition dxDrawImage On wiki have example with nametag. addEventHandler( "onClientRender",root, function( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs">ipairs( getElementsByType 'player' ) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 5 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) if x then -- getScreenFromWorldPosition returns false if the point isn't on screen dxDrawText( getPlayerName( v ), x, y, x, y, tocolor(150, 50, 0), 0.85 + ( 15 - dist ) * 0.02, "bankgothic" ) end end end end end )
-
I not understand what you mean. You need trigger this event each 100 mms?
-
Check conditions.
-
You need indicate model id for replace.
-
in function engineImportTXD 2 argument is model id, not TXD element.
-
function addAWord( uPlayer, _, ... ) local text = table.concat( { ... }, ' ' ) if text then -- if ( text ~= nil ) then it same like if text then ( if variable text is not false or nil ) -> table.insert( theCensored, text ) outputChatBox( "Added the word ' "..tostring( text ).." to the censored words , to remove it use /rcw or /removecensoreword", uPlayer, 0, 0, 100, true ) for i, v in pairs( theCensored ) do outputChatBox( tostring( i ) .. tostring( v ) ) end end end addCommandHandler( "acw", addAWord ) addCommandHandler( "addcensoreword", addAWord )
-
addEvent( 'sendMoney', true) addEventHandler( 'sendMoney', root, function ( sNick, nAmmount ) if sNick and nAmmount then local nAmmount = tonumber( nAmmount ) local nMoney = getPlayerMoney( source ) if cash >= nAmmount then local uPlayer = getPlayerFromName( sNick ) if uPlayer then givePlayerMoney( uPlayer, nAmmount ) takePlayerMoney( source, nAmmount ) outputChatBox( string.format( 'You\'ve given money amount of: %s $ to: %s', nAmmount, sNick ), source, 255, 255, 150 ) outputChatBox( string.format( '%s has given you money amount of: %s $!', getPlayerName( source ), nAmmount ), uPlayer, 255, 255, 245 ) else outputChatBox( 'Player did not exist', source, 255, 0, 0 ) end else outputChatBox( 'Insufficient founds!', source, 255, 0, 0 ) end else outputChatBox( 'DEBUG: sNick and nAmmount arguments nil or false', source, 255, 0, 0 ) end end )
-
Yes, because you not use argument in timer. Also bad idea add event handler in timer And i not understand why you need timer. Maybe you need if vehicle explode it destroyed in next seconds? function fExplode ( ) setTimer( destroyElement, 5000, 1, source ) end addEventHandler( 'onVehicleExplode', root, fExplode ) You mean it?
-
Skin https://community.multitheftauto.com/index.php?p= ... ls&id=4011 Vehicle https://community.multitheftauto.com/index.php?p= ... ls&id=4010
-
Wow, very nice. Good job!
-
Может быть потому что ты на клиенте юзаешь? Это серверный скрипт.
-
You not exported function newSkin in meta.xml.
-
You exported function newSkin in resource SQL?( did you add to meta.xml ? )
-
getElementPosition И проверяй свой объект.