Advertisement
NanoBob

Hospital GUI

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