Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: Lua  |  size: 3.67 KB  |  hits: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. GUIEditor_Window = {}
  2. blipState = false
  3.  
  4. user1 = {"Schlammy","TheGamer"}
  5. _setPlayerWantedLevel = setPlayerWantedLevel
  6.  
  7.  
  8.  
  9.  
  10.  
  11. function isValidPlayer()
  12.         local playerName = getPlayerName(localPlayer)
  13.         for index, value in ipairs(user1) do
  14.                 if value == playerName then
  15.                         return true
  16.                 end
  17.         end
  18.         return false
  19. end
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. -- HIER
  28. --
  29.  
  30.  
  31.  
  32. --[[
  33.  
  34. function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitPlayer)
  35. local derzombie = getElementData
  36. if getElement (source, "zombie") then
  37.         killPed ("zombie")
  38. end
  39. -- Add this as a handler so that the function will be triggered every time a player fires.
  40. addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFireFunc)
  41.  
  42.  
  43. -- HIER
  44. ]]--
  45.  
  46.  
  47.  
  48.  
  49.  
  50. function gui()
  51.         GUIEditor_Window[1] = guiCreateWindow(265,276,340,519,"Navy Seal",false)
  52.         Label_1_Deine_Auswahl = guiCreateLabel(36,43,125,17,"Deine Auswahl:",false,GUIEditor_Window[1])
  53.         Button1_Agent_on = guiCreateButton(33,65,154,45,"Duty",false,GUIEditor_Window[1])
  54.         gridList = guiCreateGridList(33,259,275,238,false,GUIEditor_Window[1])
  55.         guiGridListSetSelectionMode(Gridlist, 0)
  56.         Label_2_Wanted_Liste = guiCreateLabel(114,236,144,21,"Wanted Liste",false,GUIEditor_Window[1])
  57.         Button2_Agent_off = guiCreateButton(33,116,154,45,"Off Duty",false,GUIEditor_Window[1])
  58.         guiGridListAddColumn(gridList, "Spielername", 0.7)
  59.         guiGridListAddColumn(gridList, "Wanted", 0.2)
  60.         addEventHandler("onClientGUIClick", Button1_Agent_on, speichern)
  61.         addEventHandler("onClientGUIDoubleClick", gridList, showPositionAtMap, false)
  62.         addEventHandler("onClientGUIClick", Button2_Agent_off, ausgeben)
  63.         guiSetVisible(GUIEditor_Window[1], false)
  64. end
  65. function handle()
  66. if isValidPlayer() then
  67.         if GUIEditor_Window[1] == nil then
  68.                 gui()
  69.         end
  70.         if GUIEditor_Window[1] ~= nil then
  71.                 guiSetVisible(GUIEditor_Window[1], true)
  72.                 guiGridListClear(gridList)
  73.                 showCursor(true)
  74.                 for index, spieler in pairs(getElementsByType("player")) do
  75.                 local row = guiGridListAddRow(gridList)
  76.                 guiGridListSetItemText(gridList, row, 1, getPlayerName(spieler), false, false)
  77.                 guiGridListSetItemText(gridList, row, 2, tonumber(getPlayerWantedLevel(spieler)), false, false)
  78.                                        
  79.                        
  80.         end
  81.         end
  82. end
  83. end
  84. bindKey ("num_1", "down", handle)
  85.  
  86. function speichern(button,state)
  87.    if button == "left" and state == "up" then
  88.         triggerServerEvent("saveWeapons", root)
  89.                         dername = getPlayerName(getLocalPlayer())
  90.         Skin = getElementModel(getLocalPlayer())
  91.         guiSetVisible(GUIEditor_Window[1], false)
  92.         showCursor(false)
  93.    end
  94. end
  95.  
  96.  
  97. function ausgeben(button,state)
  98.    if button == "left" and state == "up" then
  99.         triggerServerEvent("regiveWeapons", root, Skin, dername)
  100.         guiSetVisible(GUIEditor_Window[1], false)
  101.         showCursor(false)
  102.    end
  103. end
  104.  
  105.  
  106.  
  107. function showPositionAtMap(button, state)
  108.         if button == "left" and state == "up" then
  109.                 if blipState == false then
  110.                         local name = guiGridListGetItemText(gridList, guiGridListGetSelectedItem(gridList), 1)
  111.                         local player = getPlayerFromName(name)
  112.                         if player then
  113.                                 local px, py, pz = getElementPosition(player)
  114.                                 blip = createBlipAttachedTo(player,56)
  115.                                 blipState = true
  116.                         end
  117.                 else
  118.                         destroyElement(blip)
  119.                         blipState = false
  120.                 end
  121.         end
  122. end
  123.  
  124.  
  125. function setPlayerWantedLevel(player, level)
  126.         local name = getPlayerName(player)
  127.         setPlayerNametagText(player, name.."("..level..")")
  128.         return _setPlayerWantedLevel(player, level)
  129. end
  130.  
  131. function beenden(player)
  132.         guiSetVisible(GUIEditor_Window[1], false)
  133.         showCursor(false)
  134. end
  135. addCommandHandler("endgui", beenden)