Jump to content

RenanPG

Members
  • Posts

    186
  • Joined

Everything posted by RenanPG

  1. 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())
  2. 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
  3. -- 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)
  4. Você poderia chamar de RGB-A que é a forma mais popular, não que java esteja errado, mas RGB é mais conhecido.
  5. 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?
  6. This page doesn't have so much details about postdata.
  7. Hello, how can i send post data to a php script? "?path=test" <-- Is it correct? fetchRemote("localhost/app/downloader/size.php", function(response, erro) -- stuff end, 100, "?path=test", false)
  8. local stats = {69,73,78,70,74,77,71,72,75,76,79,23} local check = 0 for _, v in ipairs (stats) do check = check + getPedStat (localPlayer,v) end dxDrawText(check.....)
  9. You should use triggerClientLatentEvent or fetchRemote (need a local webserver), this methods don't need to be registered in meta.
  10. Apesar de de alguns desentendimentos que minha equipe(zona:rpg) teve com vocês. Parece ser um servidor bem inovador em relação aos outros freeroam/play. Boa sorte!
  11. Probably works(i've never tried before), try it LekRoots. function getHealthColor ( ) local progress = getElementHealth ( localPlayer ) / getPedMaxHealth ( localPlayer ) local r, g, b = interpolateBetween ( 255, 0, 0, 103, 188, 107, progress, "Linear" ) return r, g, b end function getPedMaxHealth(ped) local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end
  12. RenanPG

    about PHP sdk

    Hm, what i posted is just a way to get the table inside the PHP( in that case $table ).
  13. RenanPG

    about PHP sdk

    $table = json_decode(str_replace("/example.php/","",$_SERVER["PHP_SELF"])); -- then you can whatever you want =D.
  14. RenanPG

    about PHP sdk

    callRemote ( 'http://www.yoursite.com/example.php/' .. toJSON ( playerNamesTable ), function ( value ) if ( value == 'ok' ) then -- A var from your website meaning that worked. outputDebugString ( 'Player list sent successfully.' ) end end) But... You'll need to do a php script to receive and read the data.
  15. Try this one, i'm not sure: function getHealthColor ( ) local progress = getElementHealth ( localPlayer ) / -- getPedMaxHealth ( localPlayer ) -- getPedMaxHealth server-sided, and triggered. local r, g, b = interpolateBetween ( 255, 0, 0, 103, 188, 107, progress, "Linear" ) return r, g, b end
  16. You should write your post again, no one understood your problem.
  17. Não sei se compreendi corretamente sua dúvida, mas você pode usar esse script para sincronizar o horário do jogo com a hora real. --//server-side addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() local time = getRealTime() setTime(time.hour,time.minute) setMinuteDuration(60000) end)
  18. He posted it first on community. There is nothing to do...
  19. RenanPG

    Help!

    kickPlayer doesn't need admin rights. Always see wiki, I'm not offending you. "responsiblePlayer: The player that is responsible for the event. Note: If left out as in the second syntax, responsible player for the kick will be "Console" (Maximum 30 characters if using a string)." Community. In that case the responsible is Console, probably need ACL. I didn't test.
  20. RenanPG

    Help!

    Don't forget to give admin rights on ACL.
  21. I have a radar with blips support, i can give you an example just pm me. https://fbcdn-sphotos-g-a.akamaihd.net/ ... 6019_o.jpg
×
×
  • Create New...