-
Posts
4,121 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Kenix
-
for i, v in pairs( theCensored ) do outputChatBox( tostring( i ) .. tostring( v ) ) end
-
Какое время сервер в разработке? Режим написан с 0? Разработчик только ты или у тебя команда есть?
-
You should read it https://wiki.multitheftauto.com/wiki/Scr ... troduction
-
addEventHandler( 'onClientPlayerDamage', localPlayer, cancelEvent ) All Immortals You mean it? or it addEventHandler( 'onClientPlayerDamage', root, function( uAttacker ) if uAttacker == localPlayer then cancelEvent( ) end end )
-
Try loop table.( for see values )
-
local theCensored = { "STF", -- You forgot the comma. "LOL", -- You forgot the comma. "XDD" } function fTableFind ( t , find, row, column ) if type( t ) == 'table' and type( find ) == 'string' then if type( row ) == 'number' then if t[ row ] then if string.find ( t[ row ], find ) then return true end return false end return false elseif type( row ) == 'number' and type( column ) == 'number' then if t[ row ][ column ] then if string.find ( t[ row ][ column ] , find ) then return true end return false end return false end local function fTableDimension( array ) local result = { } for _, value in pairs( array ) do if type( value ) == 'table' then for _, v in pairs( fTableDimension( value ) ) do table.insert( result, v ) end else table.insert( result, value ) end end return result end local Table = fTableDimension( t ) local returnValue = false for _ , v in pairs( Table ) do if tostring( v ) == find then returnValue = true end end return returnValue end return false end function whenSomeoneChats( msg, msgType ) local name = getPlayerName( source ) if fTableFind( theCensored, msg ) then outputChatBox( 'That is a censored word , if you think that is a mistake , contact an admin.', source, 255, 0, 0, true ) outputChatBox( '[CENSORING SYSTEM] : '.. name .. ' used an censored word. He is muted for 10 seconds from now.', root, 255, 0, 0, true ) setPlayerMuted( source,true ) setTimer( function( uPlayer, name ) setPlayerMuted( uPlayer,false ) outputChatBox( '[CENSORING SYSTEM] : The player ' .. name .. ' has been unmuted.', root, 250, 0, 0, true ) end , 10000, 1, source, name ) end end
-
Problem solved.
-
function whenSomeoneChats( msg, msgType ) local name = getPlayerName( source ) if string.find( msg,theCensored ) then outputChatBox( 'That is a censored word , if you think that is a mistake , contact an admin.', source, 255, 0, 0, true ) outputChatBox( '[CENSORING SYSTEM] : '.. name .. ' used an censored word. He is muted for 10 seconds from now.', root, 255, 0, 0, true ) setPlayerMuted( source,true ) setTimer( function( uPlayer, name ) setPlayerMuted( uPlayer,false ) outputChatBox( '[CENSORING SYSTEM] : The player ' .. name .. ' has been unmuted.', root, 250, 0, 0, true ) end , 10000, 1, source, name ) end end Updated again. Variable theCensored is defined? Also you add event handler to this function?
-
Read it please. player_Wasted is number and you want get data from number?
-
Hard way for him. local words = { "lol", "xD", "ssffdd" } function lolout( ) outputChatBox( table.concat( words, ',' ), root, 255, 0, 0, true ) end It's more easy. Output: lol,,ssffdd Can you show full code?
-
viewtopic.php?f=148&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction
-
Check variable playername where you trigger to server. addEvent( "unmark", true ) function removePin( thePlayer,playername ) local player = getPlayerFromName( playername ) if player then outputChatBox 'Debug player: condition' for _, v in pairs( getAttachedElements( player ) ) do if getElementType( v ) == "blip" then destroyElement( v ) end end else outputChatBox( "Player not found",thePlayer,255,0,0 ) end end addEventHandler( "unmark", root, removePin )
-
https://community.multitheftauto.com/index.php?p= ... ls&id=3478 https://community.multitheftauto.com/index.php?p= ... ils&id=819 https://wiki.multitheftauto.com/wiki/Call
-
Панель Ди-джея [99% compleated] Thanks to all!
Kenix replied to PSPNoobster's topic in Помощь / Отчеты об ошибках
Неверно (: http://aap13.narod.ru/PiL/2.4.html Моё мнение, что лучше создать таблицу и там всё заполнить ( позиция,скин,аним ) и потом лупить все и естественно создавать педа, делать анимацию, .. -
source use only in event, in command handler function you can use too if you define it in arguments ( server side ). Source examples: Client triggerServerEvent( 'onDownload',localPlayer ) -- We trigger to server , source is localPlayer -- I think you know, if script download then this event triggered to server. Server addEvent( 'onDownload', true ) addEventHandler( 'onDownload', root, function( ) outputChatBox( string.format( '* %s download requested files.', getPlayerName( source ) ) ) end ) Output like this: * Kenix download requested files. P.S If you not understand say me. Also you can read here: viewtopic.php?f=91&t=39678
-
First parameter in event onPlayerWasted is total ammo count ( not element player ).
-
viewtopic.php?f=91&t=39931&p=405214&hilit=repair#p405214 viewtopic.php?f=91&t=40364&p=409671&hilit=nos#p409671 local tMsg = { "--"; "--"; } setTimer( function( ) outputChatBox( tMsg[ math.random( #tMsg ) ] ) end, 120000, 0 )