Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Can you explain better please , what you want.
  2. addCommandHandler( "get", function ( ) local result = mysql_query( handler, "SELECT * FROM some_table" ) if result then local t = { } while true do local row = mysql_fetch_assoc( result ) if not row then break end table.insert( t, { name = row.playername; money = row.Money; points = row.points; } ) end -- example ------------------------------------------------------------------------ for i = 1,#t do outputChatBox( t[i]['name'] .." - ".. t[i]['money'] .." - ".. t[i]['points'] ) end -------------------------------------------------------------------------------------- mysql_free_result( result ) end end ) You can everything with this table. table.sort, ...
  3. addCommandHandler( "get", function ( ) local result = mysql_query( handler, "SELECT * FROM some_table" ) if result then while true do local row = mysql_fetch_assoc( result ) if not row then break end outputChatBox( row.playername .." - ".. row.Money .." - ".. row.points) end mysql_free_result( result ) end end )
  4. function getMapsForGm( name ) local running = getResourceFromName( name ) or exports.mapmanager:getRunningGamemode( ) if running then return exports.mapmanager:getMapsCompatibleWithGamemode( running ) end return false end Updated. Maybe you mean it?
  5. Just use onClientResourceStart. And you can not think of it.
  6. local sx, sy = guiGetScreenSize() addEventHandler( 'onClientResourceStart',resourceRoot, function( ) image1 = guiCreateStaticImage((236/800)*sx,(486/600)*sy,(366/800)*sx,(73/600)*sy,"images/grid.png",false) bar1 = guiCreateStaticImage((763/800)*sx,(5/600)*sy,(34/800)*sx,(37/600)*sy,"images/music.png",false) music = dxText:create("ASHUHASUASHUASHUASUHASHU",(246/800)*sx,(520/600)*sy,false) music:color(255,255,255,255) music:scale(0.5) music:postGUI(true) playing = dxText:create("Now playing:",(313/800)*sx,(490/600)*sy,false) playing:color(255,20,147,255) playing:scale(0.6) playing:postGUI(true) end ) All forgot event onClientResourceStart
  7. У тебя не получится сравнить строку с числом. Поэтому тебе нужно возвращаемое значение функции ( guiGetText ) преобразовать в число , чтобы проверить. Пример a = 5;b = '5' if a == b then print 'a == b' else print 'a ~= b' --> a ~= b end
  8. [ lua ] getVehicleType" class="kw2">getVehicleType [ code=lua ] getVehicleType" class="kw2">getVehicleType [ code ] getVehicleType
  9. Kenix

    Need Help

    So your code. outputChatBox ( "You are now Staff.", 0,255, 0 ) Correct outputChatBox ( "You are now Staff.", source, 0,255, 0 ) Because in server side 6 arguments , in client side 5 arguments. And you use not defiend variable thePlayer ( nil ). here setElementData( thePlayer, "Jobn", "Head Staff", true ) Correct setElementData( source, "Jobn", "Head Staff", true ) Because you add to arguments command handler function first argument 'source'. staffTeam = createTeam ( "Staff", 255, 255, 255 ) setTeamFriendlyFire ( staffTeam, false ) function joinTeam ( source ) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup( "Admin" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Moderator" ) ) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "SuperModerator" ) ) then if staffTeam then setPlayerTeam ( source, staffTeam ) setElementData( source, "Occupation", "Head Staff", true ) outputChatBox ( "You are now Staff.", source, 0,255, 0 ) end end end addCommandHandler ( "staff", joinTeam ) Full correct code. I think you not read my post just copy paste
  10. http://www.gtainside.com/en/download.php?do=cat&id=125 Поройся.
  11. local sound,state function startRadio( ) local state = not state if state then sound = playSound( 'http://217.147.86.151:20175/listen.pls' ) setSoundVolume( sound, 1.0 ) else stopSound ( sound ) end end addEventHandler( "onClientResourceStart", resourceRoot, function( ) bindKey( "0", "down", startRadio ) end )
  12. local uTimers = { } --function for take money function taxitakemoney( uPlayer,uDriver ) givePlayerMoney ( uDriver, 30 ) takePlayerMoney ( uPlayer, 30 ) end function taxi1( uPlayer, nSeat ) local nVehicleID = getElementModel ( source ) if nVehicleID == 420 and nSeat ~= 0 then local uDriver = getVehicleOccupant( source, 0 ) uTimers[ uPlayer ] = setTimer ( taxitakemoney, 30000, 0,uPlayer,uDriver ) end end addEventHandler ( "onVehicleEnter", root, taxi1 ) addEventHandler ( "onVehicleExit", root, function( uPlayer ) if isTimer( uTimers[ uPlayer ] ) then killTimer( uTimers[ uPlayer ] ) end end ) addEventHandler ( "onPlayerQuit",root, function( ) uTimers[ source ] = nil end )
  13. https://wiki.multitheftauto.com/wiki/GuiGridListAddRow не?
  14. onPlayerVehicleEnter --> проверяем место ( if seat == 0 then ).
  15. Kenix

    Tutorial

    Create your own gm , not use other gms. The best advice is, believe me.
  16. It very simple. Use google translator.
  17. All wrong ... Learn https://wiki.multitheftauto.com/wiki/Scr ... troduction
×
×
  • Create New...