Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Kenix

    help with this :|

    trigger to server with url -> trigger to all clients -> playSound.
  2. Where is self? Where are the objects? Where is methods? Where is exemplar class?
  3. It's not oop. Learn http://lua-users.org/wiki/ObjectOrientedProgramming
  4. Better check ping on client and trigger to server ( when ping > limits ) and kick player. It's more better in optimisation.
  5. Variable rootElement is not defined.
  6. Client addEvent( 'Send', true ) addEventHandler( 'Send', root, function( Table ) outputChatBox( Table.n ) -- 1 end ) Server triggerClientEvent( root, 'Send', root, { n = 1 } ) or you can use set/get elementData.
  7. Kenix

    math what?

    No problem.
  8. Kenix

    math what?

    math.floor math.ceil print( math.floor( 0.5 ) ) -- 0 print( math.ceil( 0.5 ) ) -- 1
  9. You forgot ',' here.( it's syntax error ) You don't know lua? or you forgot use ',' here? If you don't know lua. Learn https://forum.multitheftauto.com/viewtop ... 24eb26f3cc Also your variable thePlayer is stated resource.( not player )
  10. You forgot 'end' and ')' It's totally wrong.
  11. I tested before and guiSetText return false.
  12. 1. Use all arguments or write this in comments, otherwise he can understand it's normal.2. count variable is number, but you should use string. ( See wiki ) So you need use tostring function. guiSetText( text, tostring( cont ) )
  13. cont = 3 local text = guiCreateLabel() setTimer(function() cont = cont -1 guiSetText(text,cont) end,1000,3) Wrong.
  14. What you want? Explain please.
  15. If you use predefined variable root like attached element to event onClientResourceStart this will triggered if any resource started. You should use predefined variable resourceRoot.
  16. 1. You can do this via event onClientPlayerWeaponFire and createExplosion or you can make this via function setCameraMatrix 2. For loop for n = 1, 3 do -- ... end
  17. Оффтоп: Моё мнение, что самый лучший рп сервер у кернелла. По крайней мере я не видел лучше. Возможно есть что-то лучше Ghosstt13, Всегда легче присоединится к проекту, чем самомому начать. Это лишь совет. Выбор за тобой. P.S Не устраивайте срач в дальнейшем.
  18. У меня всё работает. function OnPlayerChat ( sMsg, nType ) if nType == 0 or nType == 1 then local aTime = getRealTime() local nMonth = aTime.month + 1 local nYear = aTime.year + 1900 local nMonthday = aTime.monthday local nHour = aTime.hour local nMin = aTime.minute local nSec = aTime.second local sLogFile = ':' .. getResourceName( resource ) .. '/log/' .. nMonthday ..'.' .. nMonth .. '.' .. nYear local sLogMessage = '[' .. nHour .. nMin .. nSec .. '] ' .. getPlayerName( source ) .. ': ' .. sMsg local pFile = fileExists( sLogFile ) and fileOpen( sLogFile ) or fileCreate( sLogFile ) local sText = '' while not fileIsEOF( pFile ) do sText = sText .. fileRead( pFile, 500 ) end fileWrite( pFile, sText .. sLogMessage ) fileClose( pFile ) end end addEventHandler( 'onPlayerChat', root, OnPlayerChat )
  19. triggerClientEvent(getLocalPlayer(),"ShowGUI") Читай вики.
  20. Ты не юзаешь все обязательные аргументы.
  21. И что это? Смотри. [[sERVER]] function onWasted () triggerClientEvent(source,"ShowGUI") end addEventHandler("onPlayerSpawn",getRootElement(), onWasted) Вроде так [[Client] addEvent("ShowGUI") addEventHandler("ShowGUI",getLocalPlayer(),ShowGUI) function ShowGUI () guiSetVisible(Твоёгуиокно,true) end onPlayerSpawn У тебя код не верен ..
×
×
  • Create New...