Jump to content

RenanPG

Members
  • Posts

    186
  • Joined

Everything posted by RenanPG

  1. You mean the resistance of the vehicle? setElementHealth(vehicle, 100) -- You can put values higher than 100 here. As 1000 for example.
  2. got it. the did he want to do very nice What do you mean?
  3. Use xXMADEXx's example, that you can add and remove cancelEvent.
  4. I didn't say you are lying, i'm supposing you are inventing it, but in my server and viper's server worked.
  5. I tested now, with three shoots the vehicle got exploded.
  6. -- server addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do if(isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin"))) then setElementData(player, "player:isAdmin", true) end end end) -- client addEventHandler("onClientRender", root, function() for index, player in ipairs(getElementsByType("player")) do local isAdmin = getElementData(player, "player:isAdmin") if(isAdmin) then end end end This should work, just check your debugscript.
  7. this will not work, why the rhino takes no damage, except to flames Where did you read that?
  8. You mean sending to client if certain player is or not an admin?
  9. server-side addEventHandler("onVehicleDamage", getRootElement(), function() if(getElementModel(source) == 432) then setElementHealth(source, getElementHealth(source) - 100) end end)
  10. RenanPG

    ammo

    https://wiki.multitheftauto.com/wiki/GivePedWeapon "This function gives the specified weapon to the specified ped. This function can't be used on players, use giveWeapon for that."
  11. If it's not a heavy file, you can encrypt them using somehing like: https://wiki.multitheftauto.com/wiki/Base64Encode https://wiki.multitheftauto.com/wiki/Base64Decode addEventHandler('onClientResourceStart', resourceRoot, function() local img = fileOpen('img_encrypted.png') local pixels = base64Decode(fileRead(img, fileGetSize(img))) fileClose(img) local newImg = fileCreate("img.png") fileWrite(newImg, pixels) fileClose(newImg) image = dxCreateTexture("img.png") fileDelete("img.png") end)
  12. Finalmente baniram esses dois favelados, chega de off-topic. server-side veh = createVehicle( 497, 1562.2846679688, -1613.2075195313, 13.3828125, 0, 0, 0) addEventHandler("onVehicleEnter", veh, function(client, seat) if(seat == 0) then if(getPlayerTeam(client)) and (getPlayerTeam(client) == getTeamFromName("PM")) then setVehicleEngineState(source, true) else setVehicleEngineState(source, false) outputChatBox("Somente PMs são autorizados a utilizar este veiculo!", client, 255, 255, 255, true) end end end)
  13. I know more what is OOP http://en.wikipedia.org/wiki/Object-ori ... rogramming
  14. Adiciona na pasta resources. http://www.mediafire.com/download/h96y3 ... pawner.zip
  15. server-side local vehicles = { { pickup = 1318, id = 500, x = 0, y = 0, z = 3 }, { pickup = 1318, id = 520, x = 5, y = 0, z = 3 }, } local current = {} for _, v in ipairs(vehicles) do local pickup = createPickup(v.x, v.y, v.z, 3, v.pickup, 100) addEventHandler('onPickupHit', pickup, function(player) if (current[player]) then destroyElement(current[player]) end current[player] = createVehicle(v.id, v.x, v.y, v.z + 1) warpPedIntoVehicle(player, current[player]) end) end
  16. Não exclua o sql.lua, alguns recursos do servidor fazem uso dele, so falei que você pode usar o SQLite que é mais fácil e não precissa configurar database. Na parte do car spawner você quis dizer um Pickup ou Marker para cada carro?
  17. qh = dbQuery(conn, 'SELECT * FROM table_name WHERE user_name = ?', user) local result = dbPoll( qh, -1 ) if type(result) == 'table' and #result > 0 then print('This string already exists') end This will return all columns value from the row, replace * for a certain column.
  18. There is not possible to export OOP functions(methods), but you can run the class in other resources. local oop_exemple = [[a = {} a.__index = a function a:new() local o = {name = 'test'} setmetatable(o, a) return o end function a:getName() return self.name end]] function getTable() return oop_exemple end loadstring(exports.resource_name:getTable()) () ---- to load the class local x = a:new() print(x:getName())
  19. O uso do MySQL é opcional, substitua essa parte abaixo em: "/resources/NGSQL/sql.lua" para funcionar em SQLite, dai não precisa de webserver. local dbData = { db = "nerd_gaming", host="127.0.0.1", user="root", pass="", port=3306 } outputConsole ( "attempting mysql connection... please wait") --db = dbConnect( "mysql", "dbname="..dbData.db..";host="..dbData.host..";port="..dbData.port..";unix_socket=/opt/lampp/var/mysql/mysql.sock", dbData.user, dbData.pass, "share=1;autoreconnect=1" ); db = dbConnect( "sqlite", "server_data.sql" ); E substitua os arquivos acl.xml e mtaserver.conf. Caso tenha mais algum erro use o debugscript. https://wiki.multitheftauto.com/wiki/Debugging
  20. -- Client bindKey("k", "down", function() triggerServerEvent("call:test", resourceRoot) end) -- Server function ChopperGunner ( plr ) local accName = getAccountName ( getPlayerAccount ( plr ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then blip = {} local x, y, z = getElementPosition( plr ) local Heli = createVehicle( 405, x+2, y+3, z+2 ) blip[1] = ( createBlipAttachedTo ( Heli, 41 ) ) setVehicleDamageProof ( Heli, true ) local time1 = setTimer( function() xx = createPed ( 107, x, y, z ) setPedAnimation ( xx, "ped", "SEAT_idle", -1, true, false, false ) attachElements( xx, Heli, -0.2, -2.2, 1 ) attachElements( plr, Heli, -0.4, -1.8, 0.8 ) setElementAlpha( plr, 0, true) giveWeapon( plr, 38, 9999, true ) end, 3000, 1) local time2 = setTimer( function() giveWeapon( plr, 38, 9999, true ) end, 3000, 1) local time3 = setTimer( function() setElementPosition ( plr, x, y, z ) takeWeapon ( plr, 38 ) setElementAlpha( plr, 255 ) destroyElement( Pilot ) destroyElement( xx ) destroyElement( blip[1] ) destroyElement( Heli ) end, 30000, 1) end end addEvent("call:test", true) addEventHandler("call:test", resourceRoot, function() ChopperGunner(client) end)
  21. Você poderia chamar de RGB-A que é a forma mais popular, não que java esteja errado, mas RGB é mais conhecido.
  22. so I'll steal your cashe and post to download. with my credits think that right? You caught the level bar from SAS Network cache. Is that correct?
  23. This page doesn't have so much details about postdata.
×
×
  • Create New...