Advertisement
Xross_Funky

Cluckin

Feb 1st, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.26 KB | None | 0 0
  1. sx,sy = guiGetScreenSize()
  2.  
  3. function isCursorPosition(x,y,w,h)
  4. local sx,sy=guiGetScreenSize()
  5.     if isCursorShowing() then      
  6.     local mPos = {getCursorPosition()}
  7.     cursor = {mPos[1]*sx,mPos[2]*sy}   
  8.         if cursor[1] > (x) and cursor[1] < (x) + (w) and cursor[2] > (y) and cursor[2] < (y) + (h) then
  9.             return true
  10.         else
  11.             return false
  12.         end
  13.     end
  14. end
  15.  
  16. function dxRectangulo(x,y,w,h,r,g,b,a,gui)
  17.     local dx = dxDrawRectangle (( x / 800 ) * sx,( y / 600 ) * sy,( w / 800 ) * sx,( h / 600 ) * sy,r,g,b,a,true)
  18.     return dx
  19. end
  20.  
  21. function dxTexto(texto,x,y,w,h,r,g,b,a,scale,font,alignX,alignY,clip,wordBreak,gui,ccoded,pixel)
  22.     local dxt = dxDrawText (texto,( x / 800 ) * sx,( y / 600 ) * sy,( w / 800 ) * sx,( h / 600 ) * sy,r,g,b,a,scale,font,alignX,alignY,clip,wordBreak,gui,ccoded,pixel)
  23.     return dxt
  24. end
  25.  
  26. function crearMarker(x,y,z,thetype,size,r,g,b,a,interior,dimension)
  27.     local marker = createMarker ( x, y, z , thetype, size, r, g, b , a)
  28.     if dimension then
  29.         setElementDimension(marker, dimension)
  30.     end
  31.     if interior then
  32.         setElementInterior(marker, interior)
  33.     end
  34.     return marker
  35. end
  36.  
  37. function crearPed(skin,x,y,z,r,interior,dimension,grupoA,Anim,times,loop,updatePosition)
  38.     local peds = createPed ( skin, x, y, z , r)
  39.     if dimension then
  40.         setElementDimension(peds, dimension)
  41.     end
  42.     if interior then
  43.         setElementInterior(peds, interior)
  44.     end
  45.     if grupoA then
  46.         setPedAnimation( peds, grupoA, Anim,times,loop,updatePosition)
  47.     end
  48.     return peds
  49. end
  50.  
  51. MComer = {}
  52.  
  53. MarkerCluckinE = crearMarker(928.29296875, -1352.970703125, 14.34375,"arrow",1.5,255,255,0,255)
  54. MarkerCluckinS = crearMarker(365, -11.61, 1002.7,"arrow",1.5,255,255,0,255,9,95)
  55. MComer[1] = crearMarker(367.5, -6.23046875, 1000.8,"cylinder",0.8,255,0,0,255,9,95)
  56. MComer[2] = crearMarker(371.8876953125, -6.23046875, 1000.8,"cylinder",0.8,255,0,0,255,9,95)
  57. TrabajadorCluckin1 = crearPed(167, 367.4, -4.485351562, 1001.85156,180,9,95)
  58. TrabajadorCluckin2 = crearPed(167, 371.9, -4.485351562, 1001.85156,180,9,95)
  59. TrabajadorCluckin3 = crearPed(167, 369.0, -3.806640625, 1001.85156,0,9,95,"ped", "XPRESSscratch")
  60. TrabajadorCluckin4 = crearPed(167, 370.5, -3.912109375, 1001.85888,180,9,95,"ped", "gum_eat")
  61. CivilCluckin1 = crearPed(132, 375.5, -10.25, 1002.25,90,9,95,"FOOD", "FF_Sit_Eat2",-1,true,false)
  62. ---Civil Familia Cluckin--
  63. FamiliaCluckin1 = crearPed(132, 381, -6.25, 1002.67,90,9,95,"FOOD", "FF_Sit_Eat1",0,true,false)
  64. FamiliaCluckin2 = crearPed(132, 381, -7.34, 1002.67,90,9,95,"FOOD", "FF_Sit_Eat2",0,true,false)
  65. FamiliaCluckin3 = crearPed(132, 379.64, -6.30, 1002.38,280,9,95,"FOOD", "FF_Sit_Eat3",0,true,false)
  66. FamiliaCluckin4 = crearPed(132, 379.64, -7.43, 1002.38,280,9,95,"FOOD", "FF_Sit_Look",0,true,false)
  67. --Fin Familia--
  68. ---Civil Pajera Cluckin--
  69. ParejaCluckin1 = crearPed(132, 380.89, -10.54, 1002.25,89,9,95,"FOOD", "FF_Sit_Eat1",0,true,false)
  70. ParejaCluckin2 = crearPed(132, 379.69, -10.54, 1002.25,268,9,95,"FOOD", "FF_Sit_Eat2",0,true,false)
  71. --Fin Pajera--
  72.  
  73. function cancelPedDamage ( attacker )
  74.     if source == TrabajadorCluckin1 or TrabajadorCluckin2 or TrabajadorCluckin3 or TrabajadorCluckin4 or CivilCluckin1 then
  75.         for i,v in ipairs (MComer) do
  76.         destroyElement(v)
  77.         end
  78.     end
  79. end
  80. addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage )
  81.  --setPedAnimation( TrabajadorCluckin1, "FOOD", "SHP_Tray_Lift")
  82.  
  83. function PCluckin()
  84. dxRectangulo(10, 478, 780, 112, tocolor(0, 0, 0, 184), false)
  85. dxRectangulo(10, 452, 780, 26, tocolor(0, 0, 0, 151), false)
  86. dxTexto("Bienvenido a Cluckin' Bell. Que desea?", 10, 452, 790, 478, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false)
  87. dxTexto("<", 71, 489, 165, 580, tocolor(255, 255, 255, 255), 5.00, "default-bold", "center", "center", false, false, false, false, false)
  88. dxTexto(">", 629, 488, 723, 579, tocolor(255, 255, 255, 255), 5.00, "default-bold", "center", "center", false, false, false, false, false)
  89. dxTexto("Pedido: Cajita Feliz\nAdicional: Helado\nValor: $39", 221, 488, 574, 580, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false)
  90. end
  91.  
  92. function PCluckin1(thePlayer)
  93.     if isElementWithinMarker(thePlayer, Comer1) then
  94.     addEventHandler("onClientRender",getRootElement(),PCluckin)
  95.     showCursor(true)
  96.     end
  97. end
  98. addEventHandler ( "onClientMarkerHit", getRootElement(), PCluckin1 )
  99.  
  100. function PCluckin2(thePlayer)
  101.     if isElementWithinMarker(thePlayer, Comer2) then
  102.     addEventHandler("onClientRender",getRootElement(),PCluckin)
  103.     showCursor(true)
  104.     end
  105. end
  106. addEventHandler ( "onClientMarkerHit", getRootElement(), PCluckin2 )
  107.  
  108. function TeleportCluckinE(thePlayer)
  109.     if isElementWithinMarker(thePlayer, MarkerCluckinE) then
  110.         fadeCamera(false,0)
  111.         setElementInterior( thePlayer, 9, 364.67, -9.8, 1001.87)
  112.         setElementDimension(thePlayer,95)
  113.         setTimer(function() fadeCamera(true)end,1000,1)
  114.     end
  115. end
  116. addEventHandler ( "onClientMarkerHit", getRootElement(), TeleportCluckinE )
  117.  
  118.  
  119. function TeleportCluckinS(thePlayer)
  120.      if isElementWithinMarker(thePlayer, MarkerCluckinS) then
  121.          fadeCamera(false,0)
  122.          setElementInterior( thePlayer, 0,925.56, -1352.73, 13.37)
  123.          setElementDimension(thePlayer,0)
  124.          setTimer(function() fadeCamera(true)end,1000,1)
  125.     end
  126. end
  127. addEventHandler ( "onClientMarkerHit", getRootElement(), TeleportCluckinS )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement