Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 27/02/19 in all areas

  1. Dear scripters, A few days ago I started building on a new tool/enchantment for a mta functionality. The tool is an enchantment for the trigger[Client/Server]Event function. It will be available for everybody once it is finished. I decided to build this tool as challenge for these issues: - The current trigger*events can be complex for some people to use. - CallBack functionality is not directly available. - Sending trigger events before the client has been loaded happens too often. This message will not be received. - Can't pass over arguments to the callback function without losing them or making copies. So a functionality that allows you to send tables and functions from(from A to B): [A] serverside > (clientside) > B serverside callback (Clientside is left out, while passing functions/tables) [A] clientside > (serverside) > B clientside callback (Serverside is left out, while passing these functions/tables) A question to you guys: Is there any other issue related to the trigger*Event functions that you would like to see automatically/easier?
    1 point
  2. Tente isso aqui acho que funciona, Não tenho certeza que vai funcionar. function Enter_Car (thePlayer) if not (Carro[thePlayer]) and isElement(Carro[thePlayer]) then destroyElement (Carro[thePlayer]) end end addEventHandler ("onVehicleEnter", root, Enter_Car) Não precisa citar o código toda hora Tem apenas eu e você aqui.
    1 point
  3. سهله بالنسبة لك حبيبي بس هو ما يشوفها سهله , لو يشوفها سهله مانزل موضوع ثاني شي , الإكس ام ال لها وظائف كثيرة في الويكي xmlCopyFile xmlCreateChild xmlCreateFile xmlDestroyNode xmlFindChild xmlLoadFile xmlNodeGetAttribute xmlNodeGetAttributes xmlNodeGetChildren xmlNodeGetName xmlNodeGetParent xmlNodeGetValue xmlNodeSetAttribute xmlNodeSetName xmlNodeSetValue xmlSaveFile xmlUnloadFile انت كاتب خطوات الحل و مو كاتب ايش يستخدم بالضبط ,,, والجداول اسهل بالنسبة لطلبه ( أما سالفة اللاق و ما اللاق , هذي كلها ( كلام فاضي لا لاق ولا هم يحزنون .
    1 point
  4. Você tem algum tipo de "Cheat Engine" ou algo do tipo em sua maquina? as vezes pode ser algo bobo revise algo que possa modificar o mta e remova alem disso qual anti viros você usa?
    1 point
  5. Faça assim: -- // CLIENT-SIDE addEventHandler( "onClientPlayerDamage", root, function( attacker, weapon, bodypart, loss ) cancelEvent( ); -- // Cancela o dano if ( attacker == localPlayer ) then -- // Verifica se o 'attacker' é o jogador que está dando dano e não o que está sofrendo o dano triggerServerEvent( "onClientGotDamage", localPlayer, attacker, weapon, bodypart, loss, source ); -- // Sincroniza o dano else if ( weapon == 53 ) then -- // Verifica se o jogador sofreu uma queda setElementHealth( localPlayer, loss ); -- // Sofreu? Então ele perderá vida end end end ); -- // SERVER-SIDE local TABLE_DAMAGE = { -- // [ID da Arma] = Novo Dano [23] = 20, -- // Pistola Silenciada [24] = 35, -- // Desert Eagle [30] = 25, -- // AK-47 }; addEvent( "onClientGotDamage", true ) -- // atirador, arma, bodypart, dano, alvo addEventHandler( "onClientGotDamage", root, function( attacker, weapon, bodypart, damage, target ) if ( not isPeadDead( attacker ) ) then -- // Caso o atirador esteja morto, o alvo não sofrerá mais danos local newDamage local targetArmor = getPedArmor( target ); -- // Obtém o valor do colete (se tiver) local targetHealth = getElementHealth( target ); -- // Obtém o valor da vida if ( getElementData( attacker, "mane123" ) ) then -- // A sua verificação, se ele é um "admin" local g_Damage = TABLE_DAMAGE[ weapon ] or damage; newDamage = g_Damage; if ( targetArmor > 0 ) then -- // O alvo tem colete? setPedArmor( target, targetArmor - newDamage ); else -- // O alvo não tem colete? Então bora tirar a vida dele. local h = math.max( targetHealth - newDamage, 0 ); setElementHealth( target, h ); if ( h <= 0 ) then killPed( target, attacker, weapon, bodypart, false ); end end end end end );
    1 point
  6. 1 - القسم الخطا 2 - اللي فهمتوا منك addEventHandler( 'onPlayerWasted' , root , function( ) if( getPlayerTeam( source ) == 'criminal' ) then spawnPlayer( source , x , y , z ) end end ) -- بالاحداثيات حقتك x ,y , z لا تنسي تستبدل ال --
    1 point
  7. function DeleteVIP (command, accountName) local result = dbQuery(database,"SELECT * FROM vip") local poll = dbPoll(result, -1) for i,v in ipairs(poll) do local time = getRealTime() if (tonumber(v["viptime"]) < tonumber(time.timestamp)) and (tonumber(v["viptime"]) > 0) then dbExec(database, "DELETE FROM vip WHERE id = ?", tonumber(v["id"])) local account = getAccount(accountName) if getAccountPlayer(account) == tostring(v["acc"]) then local player = getAccountPlayer(account) outputChatBox("VIP: " .. accountName .. " ", player, 255, 255, 255, true) end end end dbFree(result) end setTimer(DeleteVIP, 6000000, 0) In line 8 you had to define the 'accountName' variable. Got it ?
    1 point
  8. Can you please tell me, what happens every 1 minute when running this DeleteVIP function ?
    1 point
  9. If that peace of code run according to the timer, you can't add accountName as a handler function argument of DeleteVIP. You had to discover accountName variable before started running the line 8.
    1 point
  10. First, I think you have missed some details on 'addCommandHandler' page. Go and read that page completely one more time. https://wiki.multitheftauto.com/wiki/AddCommandHandler In server side, there are some parameters on handler function. 1. Player who command 2.The Command 3.Arguments [ from the command ] *Your handler function does not configured correctly.
    1 point
  11. Try this out : function SETVIP (source, command, accountName) local account1 = getAccountName(getPlayerAccount(source)) local serial = serial local nick = nick local time = time local time2 = time2 local VIP = vip local account = getAccount(accountName) if getAccountPlayer(account) then local player = getAccountPlayer(account) givePlayerMoney(player, 500000) outputChatBox("VIP: " .. accountName, player, 255, 255, 255, true) end end addCommandHandler("setvip", SETVIP)
    1 point
  12. @Jupiter @justboy @aLRsHide @#,~BLaaaCK @a7zan
    1 point
  13. اكتب باف 8 debugscript 3 وشوف ايش يطلع لك
    0 points
  14. @N3xT ياريت تغلق الموضوع او تحذف التعليقات الخارجة عن الموضوع ( الله يكون في عونك كل شوي تحذر وتقفل موضوع شكل )
    0 points
×
×
  • Create New...