Jump to content

Anderl

Members
  • Posts

    2,266
  • Joined

  • Last visited

Everything posted by Anderl

  1. God damnit Thought it was pPlayer in client-side and didn't exist the commandName param
  2. The code is client-side and.. mine is correct.
  3. function fnRoll( pPlayer ) local nX, nY, nZ = getElementPosition( pPlayer ); outputChatBox( getGroundPosition( nX, nY, nZ ) ); setTimer( fnRoll, 1000, 0 ); end addCommandHandler( 'test', fnRoll );
  4. addEvent( 'isTimeToPayDay', true ); addEventHandler( 'isTimeToPayDay', root, function( ) local nMoney = math.random( 400, 800 ); local nCurrent = getPlayerMoney( localPlayer ); outputChatBox( '' ); outputChatBox( '|||------------ Pay Day ------------|||', 70, 200, 0, false ); outputChatBox(" ") outputChatBox( 'Saldo actual -| #EEDDAA' .. currentMoney, 250, 250, 250, true ); outputChatBox( 'Ganho -| #EEDDAA' .. money, 250, 250, 250, true ); outputChatBox( 'Novo saldo -| #EEDDAA' .. currentMoney + money, 250, 250, 250, true ); outputChatBox( '' ); outputChatBox( '|||------------------------------------|||', 70, 200, 0, false ); exports['players']:giveMoney( localPlayer, nMoney ); givePlayerMoney( nMoney ); end ) Not tested.
  5. Then you should not make it that way. What if the markers appears in the place of a house or something like that? Create a table with random locations and create the marker at a random one.
  6. I was going to ask the same
  7. Where/when do you call the event?
  8. Dafuq. What about indentation? addEvent( 'theMarkers', true ); local aElements = { } function theMarkers( thePlayer ) --create markers aElements['marker'] = createMarker( math.random( 1431, 1613 ), math.random( -1046, -1029 ), math.random( 22.5, 22.906229019165 ), 'cylinder', 3, 255, 0, 0, 255 ); aElements['blip'] = createBlip( 0, 0, 0, 56, 3 ); --add handlers addEventHandler( 'onClientMarkerHit', aElements['marker'], fnOnMarkerHit ); addEventHandler( 'onClientMarkerLeave', aElements['blip'], fnOnMarkerLeave ); end function fnOnMarkerHit( pPlayer ) if( pPlayer == localPlayer ) then bHasPassed = false; if( isPedInVehicle( localPlayer ) ) then attachElements( aElements['marker'], aElements['blip'] ); local nRandom = math.random( 5, 100 ) + math.random( 50, 500 ); givePlayerMoney( nRandom ); outputChatBox( 'You have got #00FF00$' .. nRandom .. ' #FFFF00from the station!', 255, 255, 0, true ); bHasPassed = true; else outputChatBox( 'You must be on your Bus!' ); end end end function fnOnMarkerLeave( ) if( bHasPassed ) then destroyElement( aElements['marker'] ); destroyElement( aElements['blip'] ); end end Fixed everything I saw.
  9. Wow, these information in the topic will help me a lot learning C++.
  10. You can take the sound from the race gamemode which can be found in the resources folder of your MTA Server.
  11. local aPrices = { ['M4'] = 18000, ['Ammo M4'] = 300, ['License'] = 55000; } addEvent( 'onClientBuyWeapon', true ); addEvent( 'onClientBuyLicense', true ); addEventHandler( 'onClientBuyWeapon', root, function( sWeapon ) local pAccount = getPlayerAccount( source ); -- is source defined? local nMoney = getPlayerMoney( source ); -- is source defined? if( getAccountData( pAccount, 'GunLicense' ) ) then if( sWeapon == 'weapon_m4' ) then if( nMoney >= ( aPrices['M4'] + aPrices['Ammo M4'] ) ) then takePlayerMoney( source, aPrices['M4'] + aPrices['Ammo M4'] ); setAccountData( pAccount, 'm4data', true ); giveWeapon( source, 31, 50 ); outputChatBox( 'Você comprou uma M4!', source, 0, 255, 0, false ); else outputChatBox( 'Você não tem dinheiro para comprar uma M4!', source, 255, 0, 0, false ); end end else outputChatBox( 'Você não tem licença de arma!', source, 255, 0, 0, false ); end end ) addEventHandler( 'onClientBuyLicense', root, function( ) local pAccount = getPlayerAccount( source ); local nMoney = getPlayerMoney( source ); if( not getAccountData( pAccount, 'GunLicense' ) ) then if( nMoney >= aPrices['License'] ) then setAccountData( pAccount, 'GunLicense', true ); takePlayerMoney( source, aPrices['License'] ); outputChatBox( 'Você comprou uma licença para portar armas!', source, 0, 255, 0, false ); else outputChatBox( 'Você não tem grana suficiente para comprar a licença!', source, 255, 0, 0, false ); end else outputChatBox( 'Você já tem uma licença para portar armas!', source, 255, 0, 0, false ); end end ) The problem: You forgot an 'end'.
  12. Dafuq. Triple post Can't you wait for someone to help you?
  13. If it appears, it's because you didn't install the module correctly, no?
  14. lolz, You don't understand english? THE FUCKING DLL libmysql.dll NOT FOUND, INSTALL THE MODULE CORRECTLY. https://wiki.multitheftauto.com/wiki/Mysql
  15. MODULE: Unable to load modules/libmysql.dll ERROR: exports: Call to non-running server resource [string]] Can't you understand this? lol
  16. Did you install all the packages listed here? https://wiki.multitheftauto.com/wiki/Bui ... _GNU_Linux
  17. I wanted to know that too.
  18. Anderl

    make a server

    As far as I know, no. http://wiki.answers.com/Q/What_is_the_d ... d_a_router
  19. Anderl

    make a server

    You can use modem too.
  20. DX only gets updated cuz it's rendered every frame. That's why. A GUI Label is not updated every frame, so, no, it doesn't get updated when you change data.
  21. lolz, so much time thinking and didn't remember that way Thank you. And yes, I'm making a lib with DX functions.
  22. Anderl

    make a server

    No, you don't. I use router and works.
×
×
  • Create New...