-
Posts
4,008 -
Joined
-
Last visited
-
Days Won
184
Everything posted by Lord Henry
-
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
WARNING: editor_test\portaoilhaFAs.lua:8: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] ERROR: editor_test\portaoilhaFAs.lua:8: attempt to concatenate a boolean value -
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
It just let me with no control of the vehicle during the time, but not Freeze the vehicle. The vehicle must stop immediately when it collides. But this time, none error happened. -
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
No change...keep the errors. -
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
WARNING: editor_test\portaoilhaFAs.lua:8: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] ERROR: editor_test\portaoilhaFAs.lua:8: attempt to concatenate a boolean value -
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
This worked by foot, but not with vehicle. The vehicle needs to be freezed too. -
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
ERROR: editor_test\portaoilhaFAs.lua:8: attempt to call global 'getLocalPlayer' (a nil value) -
freeze How to freeze a player for a few seconds when he "onColShapeHit"
Lord Henry replied to Lord Henry's topic in Scripting
I know it, but I tried it on clientside and nothing happened... -
Well...I need to freeze a player during 3 seconds when he collides a ColCuboid, independent if he is in a vehicle or not. After this time, the player is unfreezed and will be only freeze again if he goes out the collider and enters it again. The collider is on a serverside script, but I read at the "Wiki MTA" an information that Freeze commands are only clientside... I tried to make all the script clientside but when I did, the script simply doesn't work and don't show any error. Reason: The player must wait the gate's movement ending so he can pass. The gate's movement lasts 3 seconds. PS: The gate is already working fine with the collider. Here is the serverside script working well without the freeze commands: gateilhaFA1 = createObject ( 968, -3341.7001953125, 458.5, 10.5, 0, 270, 270 ) ZonailhaFA1 = createColCuboid ( -3356.7001953125, 459.89999389648, 9.6999998092651, 15.0, 5, 5.0 )--Zona em cubo de colisão. function GateIlha1Open (source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("MapEditor")) then moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, 90, 0 ) outputChatBox ( "Acesso permitido.", source, 0, 255, 0, true ) else outputChatBox ( "Acesso negado.", source, 255, 0, 0, true ) end end addEventHandler ( "onColShapeHit", ZonailhaFA1, GateIlha1Open ) function GateIlha1Close () moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, -90, 0 ) end addEventHandler ( "onColShapeLeave", ZonailhaFA1, GateIlha1Close ) And here is the script with the freeze command and timer: gateilhaFA1 = createObject ( 968, -3341.7001953125, 458.5, 10.5, 0, 270, 270 ) ZonailhaFA1 = createColCuboid ( -3356.7001953125, 459.89999389648, 9.6999998092651, 15.0, 5, 5.0 )--Zona em cubo de colisão. function GateIlha1Open (source, player) local player = getLocalPlayer() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("MapEditor")) then outputChatBox ( "Acesso permitido.", source, 0, 255, 0, true ) moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, 90, 0 ) setElementFrozen( player, true ) toggleAllControls( player, false ) setTimer ( function( source ) setElementFrozen( player, false ) toggleAllControls( player, true ) end, 3000, 1 ) outputChatBox ( "Aguarde o portão se abrir.", source, 0, 255, 0, true ) else outputChatBox ( "Acesso negado.", source, 255, 0, 0, true ) end end addEventHandler ( "onColShapeHit", ZonailhaFA1, GateIlha1Open ) function GateIlha1Close () moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, -90, 0 ) end addEventHandler ( "onColShapeLeave", ZonailhaFA1, GateIlha1Close ) How to create a Freeze with collider and timer?
-
Oh... Thanks by the information, even if I could change that blip, it will show only to me, but I need to show to all players. I will search a tutorial about creating my own radar.
-
Up...
-
Hello everyone. I programmed a script that create VIP houses and when it does, it creates a green house blip on the map where the house was created. When this house is bought out by someone, the blip is changed to red house blip. But I want to keep an Yellow House blip instead of the green house blip. The blips only appear on the map when I hold the key " i " (example of how it should appear) The script calls the blips with this: bindKey( 'i', 'both', function( key, keyState ) if keyState == 'down' then for k, v in ipairs ( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'HSV_INFO' ) and getElementData( v, 'HSV_INFO' )[7] then if getElementData( v, 'HSV_INFO' )[7] ~= '' then createBlipAttachedTo( v, 32 ); --Red house blip else createBlipAttachedTo( v, 31 ); --Green house blip --createBlipAttachedTo( v, 64 ); --Yellow house blip end; end; end; else for k, v in ipairs( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'HSV_INFO' ) then for k, elem in ipairs( getAttachedElements( v ) ) do if getElementType( elem ) == 'blip' then destroyElement( elem ); end; end; end; end; end; end ); I tried to create a new blip and call him, but the MTA doesn't recognize it and send a white square instead of my new blip. Any idea?
-
I think it solved the problem, but now appears another problem: ERROR: [admin]\sistema-home\coreh_server.lua:56: attempt to call field 'Query' (a nil value) coreh_server.lua: local sqly = { Query = executesqlQuery }; addEventHandler( 'onResourceStart', resourceRoot, function() sqly.Query( "CREATE TABLE IF NOT EXISTS house_data (\ ID INTEGER, en_X REAL, en_Y REAL, en_Z REAL,\ en_tX REAL, en_tY REAL, en_tZ REAL,\ ex_X REAL, ex_Y REAL, ex_Z REAL,\ ex_tX REAL, ex_tY REAL, ex_tZ REAL,\ int INTEGER, dim INTEGER, cost INTEGER, owner TEXT, key TEXT )" ); for i, v in ipairs( getElementsByType( 'player' ) ) do setElementData( v, 'k_len', tonumber( get( 'keyLength' ) ) ); local acc = getPlayerAccount( v ); if not isGuestAccount( acc ) then setElementData( v, 'HSV_accountName', getAccountName( acc ) ); end; setElementData( v, 'mrk_in', nil ); end; local hr = sqly.Query( "SELECT * FROM house_data" ); for i = 1, #hr do createHouseVip( false, hr[i].ID, hr[i].owner, hr[i].key, hr[i].en_X, hr[i].en_Y, hr[i].en_Z, hr[i].en_tX, hr[i].en_tY, hr[i].en_tZ, hr[i].ex_X, hr[i].ex_Y, hr[i].ex_Z, hr[i].ex_tX, hr[i].ex_tY, hr[i].ex_tZ, hr[i].int, hr[i].dim, hr[i].cost ); end; end ); addEventHandler( 'onResourceStop', resourceRoot, function() for i, v in ipairs( getElementsByType( 'player' ) ) do setElementData( v, 'k_len', nil ); setElementData( v, 'HSV_accountName', nil ); end; end ); addEventHandler( 'onPlayerJoin', root, function() setElementData( source, 'k_len', tonumber( get( 'keyLength' ) ) ); end ); addEventHandler( 'onPlayerLogin', root, function( _, acc ) setElementData( source, 'HSV_accountName', getAccountName( acc ) ); end ); addEventHandler( 'onPlayerLoout', root, function( _, acc ) setElementData( source, 'HSV_accountName', nil ); end ); addCommandHandler( 'home', function( player ) if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Console' ) ) or hasObjectPermissionTo( player, 'function.banPlayer', false ) then if not getElementData( player, 'HPV_Opened' ) and not getElementData( player, 'mrk_in' ) then triggerClientEvent( player, 'HPV_SetVisible', root, true ); end; else outputChatBox( 'Acesso negado para este comando!', player, 255, 36, 51 ); end; end ); addEvent( 'onPlayerAttemptCreateHouseVip', true ); addEventHandler( 'onPlayerAttemptCreateHouseVip', root, function( rt ) createHouseVip( true, #sqly.Query( "SELECT * FROM house_data" ) + 1, '', '', unpack( rt ) ); outputChatBox( 'A casa VIP foi criada com sucesso!', client, 255, 255, 0 ); end );
-
I can't find an error in this script, what's wrong here? The message says that the event is not added serverside... coreh_client.lua local tableToSendVip = { [1] = guiGetText( hc_edith['edith_ec_X'] ), [4] = guiGetText( hc_edith['edith_etc_X'] ), [2] = guiGetText( hc_edith['edith_ec_Y'] ), [5] = guiGetText( hc_edith['edith_etc_Y'] ), [3] = guiGetText( hc_edith['edith_ec_Z'] ), [6] = guiGetText( hc_edith['edith_etc_Z'] ), [7] = guiGetText( hc_edith['edith_exc_X'] ), [10] = guiGetText( hc_edith['edith_extc_X'] ), [8] = guiGetText( hc_edith['edith_exc_Y'] ), [11] = guiGetText( hc_edith['edith_extc_Y'] ), [9] = guiGetText( hc_edith['edith_exc_Z'] ), [12] = guiGetText( hc_edith['edith_extc_Z'] ), [13] = guiGetText( hc_guih['edith_intID'] ), [14] = guiGetText( hc_guih['edith_dim'] ), [15] = guiGetText( hc_guih['edith_cost'] ) }; for i, v in ipairs( tableToSendVip ) do tableToSendVip[ i ] = tonumber( tableToSendVip[ i ] ); end; triggerServerEvent( 'onPlayerAttemptCreateHouseVip', me, tableToSendVip ); triggerEvent( 'HPV_SetVisible', me, false ); end, false ); coreh_server.lua addEvent( 'onPlayerAttemptcreateHouseVip', true ); addEventHandler( 'onPlayerAttemptcreateHouseVip', root, function( rt ) createHouseVip( true, #sqly.Query( "SELECT * FROM house_data" ) + 1, '', '', unpack( rt ) ); outputChatBox( 'A casa VIP foi criada com sucesso!', client, 255, 255, 0 ); end ); Any ideas?
-
console Is there a way to Force a player to disconnect or quit?
Lord Henry replied to Lord Henry's topic in Scripting
Because I do not want the player to know who kicked him for safety. I am thinking of cases where the server was hacked and the hackers changed the ACLs. So I must do it without being in the server and without any player realizes what I'm doing. -
console Is there a way to Force a player to disconnect or quit?
Lord Henry posted a topic in Scripting
Hello everyone. I was testing some commands on Console, and I can use normally this to make the player User#ff00ffname logout from the server. aexec User#ff00ffname logout BUT If I try this below, it doesn't work. aexec User#ff00ffname disconnect or aexec User#ff00ffname quit Can someone explain a way to make it? Or it is not possible anyway? -
[BUG] Error while changing scale from the objects
Lord Henry replied to Lord Henry's topic in Support
But I need to change the object size inside the Map Editor. I don't use mod's objects, I only use original objects. -
Olá a todos. Recentemente um servidor chamado BRASIL VIDA REAL 2.0 - by Brasileiros For Fun está fazendo uso indevido de nome e imagem de outro servidor com este mesmo nome que foi fechado por motivos de segurança. O servidor original sofria diversos ataques ao console, de hackers que foram "contratados" por outros servers concorrentes. Além disso o servidor tinha aproximadamente 70 players online, muita organização e disciplina. Era o server pioneiro em fazer o sistema Gangs e Corporações funcionar sem bagunça, atraindo cada vez mais os jogadores de outros servers de modos parecidos. Infelizmente, após o fechamento do servidor original, surgiu outro servidor com o mesmo nome se passando pelo oficial e usando a mesma imagem do servidor original. O servidor Fake é bem parecido com o original, vários Mods iguais e maneira de funcionar. Mas eles não tem alguns Mapas que foram desenvolvidos exclusivamente pelos desenvolvedores originais, e também não possuem qualquer relação com os Donos do servidor original. Os Donos do servidor original já derrubaram duas vezes o servidor Fake mas ele voltou a funcionar com o mesmo nome e se passando pelo oficial. Eles estão pensando em entrar com uma ação judicial contra o dono do servidor Fake. Este por sua vez já foi notificado pelo uso não autorizado de nome e marca da Brasileiros For Fun mas não tomou qualquer atitude para mudar a situação. Página do servidor oficial no Facebook: https://www.facebook.com/brasileirosforfun/ RaidCall do servidor oficial: 10484463 IP: Desativado Página do servidor Fake no Facebook: https://www.facebook.com/Mta-Br-Brasil- ... 497863088/ RaidCall do servidor Fake: 7580936 IP: mtasa://192.99.182.40:22333
-
Hello. This problem is very old but it wasn't solved yet. When I gonna change the scale of a object, the collision keeps the same size, so the character can only cross by half the object. I think the collider should also change its scale together with the object, this way, the character can't (or can, if the user disable collisions) cross all the object.
