JUNIORCEDE1

Untitled

Nov 27th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. modo = nil
  2.  
  3. addEventHandler('onResourceStart',root,function(recurso)
  4.     if recurso == getThisResource() then
  5.         for _,v in ipairs(getResources()) do
  6.             if v.state == 'running' and v:getInfo('type') == 'gamemode' then
  7.                 modo = v.name
  8.                 triggerClientEvent('actualizarModo',root,modo,InfoModo(modo))
  9.             end
  10.         end
  11.     end
  12.    
  13.     if recurso:getInfo('type') ~= 'gamemode' then return end
  14.     if recurso.state == 'running' then
  15.         modo = recurso.name
  16.     end
  17.     if modo then
  18.         triggerClientEvent('actualizarModo',root,modo,InfoModo(modo))
  19.     end
  20. end)
  21.  
  22. addEventHandler("onPlayerLogin", root,
  23.   function()
  24.     if modo then
  25.         triggerClientEvent('actualizarModo',source,modo)
  26.     end
  27.   end
  28. )
  29.  
  30. function InfoModo(GM)
  31.     local info = {}
  32.     local xml = XML.load('infogui.xml') --o crear un xml para cada gm y obtener los nodos con GM..'.xml'
  33.     if xml then        
  34.         for k,v in pairs(xml.children) do
  35.        
  36.         end
  37.         xmlUnloadFile(xml)             
  38.     else
  39.         outputDebugString('ERROR CRITICO > NO SE ENCONTRĂ“ EL ARCHIVO infogui.xml',1,255,0,0)
  40.     end
  41.     return info
  42. end
Add Comment
Please, Sign In to add comment