Jump to content

[Help]createMarkers


raynner

Recommended Posts

I am creating a hunger for script and there are only two steps however I have had many failures in my attempts frustrating the system of eating is correct however lack add marks to enter the interior and a way to remove money from the player would be grateful if you help me without

Marks - this really do not know what to do ..

Entradas = 
    { 
        {2398,-1898,13}, 
        {2420,-1509,23}, 
        {2106,-1806,14}, 
        {1200,-918,43}, 
        {929,-1352,13}, 
        {812,-1616,13}, 
        {2334,76,26}, 
        {1368,249,19}, 
        {204,-202,2}, 
        {-2155,-2460,30}, 
        ------ LV 
        {2084,2225,11}, 
        {2103,2229,11}, 
        {2352,2533,10}, 
        {2394,2042,10}, 
        {2473,2035,11}, 
        {1873,2072,11}, 
        {1159,2073,11}, 
        {2170,2796,10}, 
        ------ SF 
        {1816,619,35}, 
        {-1720,1360,7}, 
        {1912,829,35}, 
        {-2356,1009,50}, 
        {-2336,166,35}, 
        {-2671,259,3} 
    } 
Interior = 
    { 
        {373,-133,1001,5}, -- Pizza 
        {366,-11,1001,9}, 
        {364,-74,1001,10} -- Burg Shot 
    } 
---------------------------------------------- 
function Entrada() 
    for i,v in ipairs (Entradas) do 
    local marker1 = createMarker ( v[1], v[2], v[3], 2.2, "arrow", 2, 255, 255, 0, 200 ) 
       -- 
       setElementInterior ( marker1, 0 ) 
       setElementDimension ( marker1, 0 ) 
    end 
end 
addEventHandler ( "onResourceStart", Entradas, getRootElement()) 

Money -this need to use getPlayerMoney and setPlayerMoney but do not know how -50 $ everything works correctly less money

function(hitEle,dim) 
  if (getLocalPlayer() == hitEle) and (getElementData (source,"HAMBURGER!") == true) then 
    if (getHungerState (hitEle) < 83) then 
      progress = max 
      setElementHealth (hitEle,getElementHealth (hitEle) +50) 
      setPlayerMoney(hitEle,getPlayerMoney (hitEle) -50) 
      setHungerState (hitEle,100) 
      outputChatBox ("#CCFF00[#FFA600 ! #CCFF00] #0080FFHum Otima Comida, Bom!",255,255,255,true) 
      outputChatBox ("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Não Esta Mais Com Fome \"{SMILIES_PATH}/icon_biggrin.gif\" alt=\"\" title=\"Very Happy\" />",255,255,255,true) 
    else 
      outputChatBox ("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Não Precisa Comer Agora!",255,255,255,true) 
    end 
  end 
end) 

Link to comment

The markers:

  for i,v in ipairs (Entradas) do 
local x,y,z = unpack(v) 
    local marker1 = createMarker ( x,y,z, 2.2, "arrow", 2, 255, 255, 0, 200 ) 
       -- 
       setElementInterior ( marker1, 0 ) 
       setElementDimension ( marker1, 0 ) 
    end 

Also, do NEVER use money-related function clientside. That's why it doesn't works probably. Use takePlayerMoney serverside

Link to comment

After long time loggin in.

Try this out

  
Entradas = 
    { 
        {2398,-1898,13}, 
        {2420,-1509,23}, 
        {2106,-1806,14}, 
        {1200,-918,43}, 
        {929,-1352,13}, 
        {812,-1616,13}, 
        {2334,76,26}, 
        {1368,249,19}, 
        {204,-202,2}, 
        {-2155,-2460,30}, 
        ------ LV 
        {2084,2225,11}, 
        {2103,2229,11}, 
        {2352,2533,10}, 
        {2394,2042,10}, 
        {2473,2035,11}, 
        {1873,2072,11}, 
        {1159,2073,11}, 
        {2170,2796,10}, 
        ------ SF 
        {1816,619,35}, 
        {-1720,1360,7}, 
        {1912,829,35}, 
        {-2356,1009,50}, 
        {-2336,166,35}, 
        {-2671,259,3} 
    } 
Interior = 
    { 
        {373,-133,1001,5}, -- Pizza 
        {366,-11,1001,9}, 
        {364,-74,1001,10} -- Burg Shot 
    } 
---------------------------------------------- 
function Entrada() 
    for i,v in ipairs (Entradas) do 
    local marker1 = createMarker ( v[1], v[2], v[3], 2.2, "arrow", 2, 255, 255, 0, 200 ) 
       -- 
       setElementInterior ( marker1, 0 ) 
       setElementDimension ( marker1, 0 ) 
    end 
end 
addEventHandler ( "onResourceStart", getRootElement(), Entrada) 
  

Link to comment
The markers:
  for i,v in ipairs (Entradas) do 
local x,y,z = unpack(v) 
    local marker1 = createMarker ( x,y,z, 2.2, "arrow", 2, 255, 255, 0, 200 ) 
       -- 
       setElementInterior ( marker1, 0 ) 
       setElementDimension ( marker1, 0 ) 
    end 

Also, do NEVER use money-related function clientside. That's why it doesn't works probably. Use takePlayerMoney serverside

Thank You

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...