Advertisement
NanoBob

Hospital GUI

Mar 26th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.94 KB | None | 0 0
  1. sx,sy = guiGetScreenSize()
  2. hospitalWindow = guiCreateWindow(sx/3,sy/3,0.2,0.1,"",false)
  3. hospitalButton = guiCreateButton(1,0.5,0.5,0.9,"Hospital ($100)",true,hospitalWindow)
  4. hospitalProgress = guiCreateProgressBar(0.5,0.5,0.45,0.1,true,hospitalWindow)
  5. cancelButton = guiCreateButton(0.7,0.7,0.6,0.5,true,hospitalWindow)
  6. addProgress = setTimer(addProg,1000,10)
  7. timeNoHospital = setTimer(cancelHospital,10000,1)
  8. guiSetVisible(hospitalWindow,false)
  9.    
  10. function hospitalGUI()
  11.     guiSetVisible(hospitalWindow,true)
  12.     showCursor(true)
  13. end
  14. addEventHandler("onClientPlayerWasted",getElementRoot(),hospitalGUI)
  15. function addProg()
  16.     guiProgressBarSetProgress(hospitalProgress,guiProgressBarGetProgress+10)
  17. end
  18. function cancelHospital()
  19.     triggerEvent("drawSpawnPanel",localPlayer)
  20.     guiSetVisible(hospitalWindow,false)
  21. end
  22. addEventHandler("onClientGUIClick",cancelButton,cancelHospital)
  23. function citySelect()
  24.     x,y,z = getElementPosition(localPlayer)
  25.    
  26.     if getZoneName(x,y,z,true)=="Los Santos" and getElementData(localPlayer,"FGNMoney")>=100 then          
  27.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  28.       setElementHealth(localPlayer,100)
  29.       setElementPosition(localPlayer,2026.5799560547,-1404.7811279297,17.676984786987)
  30.       killTimer(addProgress)
  31.       killTimer(timeNoHospital)
  32.       guiSetVisible(hospitalWindow,false)
  33.     elseif getZoneName(x,y,z,true)=="Las Venturas" and getElementData(localPlayer,"FGNMoney")>=100 then
  34.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  35.       setElementHealth(localPlayer,100)
  36.       setElementPosition(localPlayer,1607.4057617188,1816.6859130859,10.8203125)
  37.       killTimer(addProgress)
  38.       killTimer(timeNoHospital)
  39.       guiSetVisible(hospitalWindow,false)
  40.     elseif getZoneName(x,y,z,true)=="San Fierro" and getElementData(localPlayer,"FGNMoney")>=100 then
  41.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  42.       setElementHealth(localPlayer,100)
  43.       setElementPosition(localPlayer,-2653.0070800781,637.65576171875,14.453125)
  44.       killTimer(addProgress)
  45.       killTimer(timeNoHospital)
  46.       guiSetVisible(hospitalWindow,false)
  47.     elseif getZoneName(x,y,z,true)=="Bone County" and getElementData(localPlayer,"FGNMoney")>=100 then
  48.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  49.       setElementHealth(localPlayer,100)
  50.       setElementPosition(localPlayer,-322.94583129883,1054.9509277344,19.7421875)
  51.       killTimer(addProgress)
  52.       killTimer(timeNoHospital)
  53.       guiSetVisible(hospitalWindow,false)
  54.     elseif getZoneName(x,y,z,true)=="Red County" and getElementData(localPlayer,"FGNMoney")>=100 then
  55.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  56.       setElementHealth(localPlayer,100)
  57.       setElementPosition(localPlayer,1243.1016845703,328.97875976563,19.7578125)
  58.       killTimer(addProgress)
  59.       killTimer(timeNoHospital)
  60.       guiSetVisible(hospitalWindow,false)
  61.     elseif getZoneName(x,y,z,true)=="Tierra Robada" and getElementData(localPlayer,"FGNMoney")>=100 then
  62.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  63.       setElementHealth(localPlayer,100)
  64.       setElementPosition(localPlayer,-1514.6719970703,2525.2822265625,55.778884887695)
  65.       killTimer(addProgress)
  66.       killTimer(timeNoHospital)
  67.       guiSetVisible(hospitalWindow,false)
  68.     elseif getZoneName(x,y,z,true)=="Whetstone" and getElementData(localPlayer,"FGNMoney")>=100 then
  69.       setElementData(localPlayer,"FGNMoney",getElementData(localPlayer,"FGNMoney")-100)
  70.       setElementHealth(localPlayer,100)
  71.       setElementPosition(localPlayer,-2209.2348632813,-2287.8542480469,30.625)
  72.       killTimer(addProgress)
  73.       killTimer(timeNoHospital)
  74.       guiSetVisible(hospitalWindow,false)
  75.     end
  76.     showCursor(false)
  77. end
  78. addEventHandler("onClientGUIClick",hospitalButton,citySelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement