Anderl
Members-
Posts
2,266 -
Joined
-
Last visited
Everything posted by Anderl
-
God damnit Thought it was pPlayer in client-side and didn't exist the commandName param
-
The code is client-side and.. mine is correct.
-
function fnRoll( pPlayer ) local nX, nY, nZ = getElementPosition( pPlayer ); outputChatBox( getGroundPosition( nX, nY, nZ ) ); setTimer( fnRoll, 1000, 0 ); end addCommandHandler( 'test', fnRoll );
-
Client-side, no.
-
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.
-
Random location, lol.
-
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.
-
I was going to ask the same
-
Where/when do you call the event?
-
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.
-
Wow, these information in the topic will help me a lot learning C++.
-
You can take the sound from the race gamemode which can be found in the resources folder of your MTA Server.
-
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'.
-
Dafuq. Triple post Can't you wait for someone to help you?
-
If it appears, it's because you didn't install the module correctly, no?
-
lolz, You don't understand english? THE FUCKING DLL libmysql.dll NOT FOUND, INSTALL THE MODULE CORRECTLY. https://wiki.multitheftauto.com/wiki/Mysql
-
MODULE: Unable to load modules/libmysql.dll ERROR: exports: Call to non-running server resource [string]] Can't you understand this? lol
-
Did you install all the packages listed here? https://wiki.multitheftauto.com/wiki/Bui ... _GNU_Linux
-
I wanted to know that too.
-
As far as I know, no. http://wiki.answers.com/Q/What_is_the_d ... d_a_router
-
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.
-
lolz, so much time thinking and didn't remember that way Thank you. And yes, I'm making a lib with DX functions.
-
No, you don't. I use router and works.
