Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Kenix

    Hi all

    It's not solution in this situation.
  2. Kenix

    Hi all

    Try this function FindReachPlayers( nPlayersCount ) if type( nPlayersCount ) == 'number' then local nStart = 0 local pAddPlayer local nIndexRemove = 0 local aReturnPlayers = { } local aReachPlayers = { } for _, pPlayer in pairs( getElementsByType 'player' ) do table.insert( aReachPlayers, { [ pPlayer ] = getPlayerMoney( pPlayer ) } ) end for n = 1, nPlayersCount do for nIndex, a in ipairs( aReachPlayers ) do for pPlayer, nMoney in pairs( a ) do if nStart <= nMoney then nStart = nMoney nIndexRemove = nIndex pAddPlayer = pPlayer end end end if not aReachPlayers[ nIndexRemove ] then return aReturnPlayers end table.insert( aReturnPlayers, { [ pAddPlayer ] = nStart } ) table.remove( aReachPlayers, nIndexRemove ) nIndexRemove = 0 nStart = 0 end return aReturnPlayers end return false end Updated again. Example of use: for _, a in ipairs( FindReachPlayers( 3 ) ) do for pPlayer, nMoney in pairs( a ) do outputChatBox( 'Player = ' .. getPlayerName( pPlayer ) .. ' , Money = ' .. nMoney ) end end
  3. Kenix

    Hi all

    getPlayerMoney dxDrawText + event https://wiki.multitheftauto.com/wiki/OnClientRender
  4. You should add exported function getBadges to meta.xml function="function_name" type="server/client" http="true/false" />
  5. function RemoveHEXColorCode( s ) return s:gsub( '#%x%x%x%x%x%x', '' ) or s end
  6. Kenix

    Msg Player Problem

    local nRow, nColumn = guiGridListGetSelectedItem( PlayerGridList ) if nRow ~= - 1 and nColumn ~= - 1 then -- Just create this condition. local playerName = guiGridListGetItemText ( PlayerGridList, nRow, 1 ) -- TODO end
  7. Безусловно мускул. http://ru.wikipedia.org/wiki/MySQL
  8. Maybe else ? it's wrong. You should use getPlayerAccount source is not account. local acc = getAccountName( getPlayerAccount( source ) )
  9. Agree with Dwane. It's stupid condition. Why check type value(boolean, nil) (if country == false then, if country == nil then)???? if not country then -- this condition working if variable country nil or false
  10. It's a stupid idea compiling each resource for community. All should see the code. I know some situations where guys compile resources with commands like /giveadmin, /shutdown and upload them to the community. In your place I would write your owns.
  11. ИМХО. В мта не хватает уникальных и в тоже время интересных режимов. Можно самому убедиться. Почти все серверы используют один и тот же режим. Нету уникальности вообще. Я иногда захожу в мта, смотрю серверы и всегда одно и тоже. Экспериментрийте, вам никто не машает. На форуме если есть вопросы, то задавайте. Пишите мне в пм если надо, я с радостью отвечу и помогу. Народ, я серьёзно, делайте ах*енные режимы.
  12. illestiraqi You should write it yourself. Learn https://forum.multitheftauto.com/viewtop ... 0db4dbec00 https://wiki.multitheftauto.com/wiki/Scr ... troduction
  13. http://dev.mysql.com/doc/refman/5.6/en/tutorial.html https://wiki.multitheftauto.com/wiki/Ser ... _functions
  14. http://code.google.com/p/multi-theft-au ... p&can=2&q=
  15. Use getPedTask function IsElementInWater( pElement ) if pElement and isElement( pElement ) and getElementType( pElement ) == 'player' or getElementType( pElement ) == 'ped' then return getPedTask( pElement, 'primary', 2 ) == 'TASK_COMPLEX_IN_WATER' end return false end
  16. getElementsByType - return table with elements. In your case it's sounds elements.
  17. you should use getResourceFromName instead of variable zombies and check resource (loaded/running). local pZombieResource = getResourceFromName 'zombies' setTimer( function( ) local nHour = getTime( ) -- get hour if nHour == 0 then if getResourceState( pZombieResource ) == 'loaded' then -- check startResource( pZombieResource ) -- start resource outputChatBox 'La horda de zombies ha comenzado!' end elseif nHour == 4 then if getResourceState( pZombieResource ) == 'running' then -- check stopResource( pZombieResource ) -- stop resource outputChatBox 'La horda se ha detenido!' end end end, 1000, 0 ) Don't forget add rights for this resource.
  18. thePlayer not defined. Replace to hitPlayer .
×
×
  • Create New...