Jump to content

bartje01

Members
  • Posts

    208
  • Joined

  • Last visited

Posts posted by bartje01

  1. My pickups didn't work after I added the money part. What's wrong with it?

      
    function armourBlock(pickup,dimension) 
    local money = getPlayerMoney(thePlayer)                                -- get the amount of money from the player who entered the command 
         
        if (pickup == pick1) then  
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementInterior ( source, 18, 1702.97,-1667.89,20.21 )  -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)    
            end 
            else 
            if (pickup == pick2) then  
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementPosition ( source,2189.42,-1705.63,96.37) -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)  
            end 
            else 
            if (pickup == pick3) then  
             
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementPosition ( source,2176.76,-1728.92,96.37)  -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)   
            end 
            else 
            if (pickup == pick4) then  
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementInterior ( source, 0, 2176.47,-1729.39,96.37 )  -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)   
            end 
        end 
        end 
        end 
        end 
    end 
    addEventHandler("onPlayerPickupHit",getRootElement(),armourBlock) 
      
    

    [2011-03-15 22:33:22] WARNING: zombies\zombie_server.lua:712: Bad argument @ 'getPlayerMoney'

    [2011-03-15 22:33:22] ERROR: zombies\zombie_server.lua:722: attempt to compare number with boolean

    [2011-03-15 22:33:25] WARNING: zombies\zombie_server.lua:712: Bad argument @ 'getPlayerMoney'

    [2011-03-15 22:33:25] ERROR: zombies\zombie_server.lua:722: attempt to compare number with boolean

    [2011-03-15 22:33:33] WARNING: zombies\zombie_server.lua:712: Bad argument @ 'getPlayerMoney'

    [2011-03-15 22:33:33] ERROR: zombies\zombie_server.lua:715: attempt to compare number with boolean

    {/code]

  2. My pickups didn't work after I added the money part. What's wrong with it?

      
    function armourBlock(pickup,dimension) 
    local money = getPlayerMoney(thePlayer)                                -- get the amount of money from the player who entered the command 
         
        if (pickup == pick1) then  
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementInterior ( source, 18, 1702.97,-1667.89,20.21 )  -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)    
            end 
            else 
            if (pickup == pick2) then  
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementPosition ( source,2189.42,-1705.63,96.37) -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)  
            end 
            else 
            if (pickup == pick3) then  
             
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementPosition ( source,2176.76,-1728.92,96.37)  -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)   
            end 
            else 
            if (pickup == pick4) then  
            if (money > 500) then                                                 -- if money is more than 1000 
            setElementInterior ( source, 0, 2176.47,-1729.39,96.37 )  -- output this message together with the money 
        else 
            outputChatBox("You need at least $500 to use the door", thePlayer)   
            end 
        end 
        end 
        end 
        end 
    end 
    addEventHandler("onPlayerPickupHit",getRootElement(),armourBlock) 
      
    

    [2011-03-15 22:33:22] WARNING: zombies\zombie_server.lua:712: Bad argument @ 'getPlayerMoney'

    [2011-03-15 22:33:22] ERROR: zombies\zombie_server.lua:722: attempt to compare number with boolean

    [2011-03-15 22:33:25] WARNING: zombies\zombie_server.lua:712: Bad argument @ 'getPlayerMoney'

    [2011-03-15 22:33:25] ERROR: zombies\zombie_server.lua:722: attempt to compare number with boolean

    [2011-03-15 22:33:33] WARNING: zombies\zombie_server.lua:712: Bad argument @ 'getPlayerMoney'

    [2011-03-15 22:33:33] ERROR: zombies\zombie_server.lua:715: attempt to compare number with boolean

    {/code]

  3. Hey guys. Iwant a pickup inside an interior.

    Do I need to add something extra? I want it in interior ID 18:

    local pick4 = createPickup (1700.61,-1667.87,20.21,3,1272,0)

    That's my line. Doesn't shows up.

  4. I see. There is another function:

      
    addEvent( "onZombieSpawn", true ) 
    function RanSpawn_Z ( gx, gy, gz, rot) 
        local safezone = 0 
        local allradars = getElementsByType("radararea") 
        for theKey,theradar in ipairs(allradars) do 
            if getElementData(theradar, "zombieProof") == true then 
                if isInsideRadarArea ( theradar, gx, gy ) then 
                    safezone = 1 
                end 
            end 
        end 
        if safezone == 0 then 
            if table.getn ( everyZombie ) < newZombieLimit then 
                if not rot then 
                    rot = math.random (1,359) 
                end 
                randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) 
                    locations = { 
        {1676.63,-1717.06,13.54}, 
    {1542.68,-1675,13.55}, 
    {1676.63,-1717.06,13.54} 
    } 
      
                for i,v in pairs(locations) do 
                local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), (v[1],v[2],v[3])) 
                if zomb ~= false then 
                    setElementData ( zomb, "zombie", true  ) 
                    table.insert( everyZombie, zomb )    
                    setTimer ( function (zomb, rot) if ( isElement ( zomb ) ) then setPedRotation ( zomb, rot ) end end, 500, 1, zomb, rot ) 
                    setTimer ( function (zomb) if ( isElement ( zomb ) ) then setPedAnimation ( zomb, "ped", chaseanim, -1, true, true, true ) end end, 1000, 1, zomb ) 
                    setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "status", "idle" ) end end, 2000, 1, zomb ) 
                    triggerClientEvent ( "Zomb_STFU", getRootElement(), zomb ) 
                end 
            end 
        end 
    end 
      
    addEventHandler( "onZombieSpawn", getRootElement(), RanSpawn_Z ) 
      
    

    I added your part. Error + Warning on this line:

    local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), (v[1],v[2],v[3]))

      
    [2011-03-13 23:27:32] SCRIPT ERROR: zombies\zombie_server.lua:701: 'end' expected (to close 'function' at line 385) near '<eof>' 
    [2011-03-13 23:27:32] WARNING: Loading script failed: zombies\zombie_server.lua:701: 'end' expected (to close 'function' at line 385) near '<eof>' 
      
    

  5.   
        locations = { 
    {1542.68,-1675,13.55}, 
    {1676.63,-1717.06,13.54} 
    } 
      
    for i,v in pairs(locations) do 
    local zomb = createPed (v[1],v[2],v[3]) 
             
        end 
             
      
    

    Only the first spawn works :(

  6. you must make differents locals whit different names and different locations...

    That's what I mean. I can't do that. Because there are to many things I have to edit and suchs things.

  7. local zomb = createPed (1542.68,-1675,13.55) 
    local zomb = createPed (1542.68,-1675,13.55) 
    

    Won't work

    and if I do

    local zomb2 = createPed (1542.68,-1675,13.55) 
    

    I will have many things to edit

  8. Hey guys. I have a script and it should change your name color with /namecolor [1] [2] [3]

    But my name keeps being white.

    it's only colored in death list

      
    function nametagColorChange ( thePlayer, commandName, r, g, b ) 
    if r and g and b then 
    setPlayerNametagColor ( thePlayer, tonumber(r), tonumber(g), tonumber(b) ) 
    else 
    outputChatBox("If you want to change your name color use /namecolor [color1] [color2] [color3]", thePlayer, 111,111, 111) 
      end 
    end 
    addCommandHandler ( "namecolor", nametagColorChange) 
      
    

    please help

  9. Hey guys. I made a gui window with stats myself. It works by the way. Just one problem

    I want that it shows up with /stats. That works But I also want that it closes with /stats once it is visable

      
    function playerStats (  ) 
        triggerServerEvent ( "onShowStats", getLocalPlayer()) 
    end 
    addCommandHandler ( "stats", playerStats ) 
    addEvent( "SendAccountData", true ) 
    addEventHandler( "SendAccountData", getRootElement(), function(cash,deaths,adminlevel) 
        outputChatBox ( "Money: ".. tostring( cash ) ) 
         outputChatBox ( "Deaths: ".. tostring( deaths)  ) 
         outputChatBox ( "Adminlevel: ".. tostring( adminlevel ) ) 
         local statWindow = guiCreateWindow ( 0.3367,0.0391,0.3352,0.3018, "Stats", true ) 
         guiCreateLabel(0.0676,0.1327,0.0956,0.0550, "Money:", true, statWindow) 
         guiCreateLabel(0.1702,0.1359,0.2153,0.0518, tostring( cash ) , true, statWindow) 
         guiCreateLabel(0.0676,0.2104,0.0956,0.0583, "Deaths:", true, statWindow) 
         guiCreateLabel(0.1725,0.2104,0.1538,0.0550, tostring( deaths ) , true, statWindow) 
         if ( guiGetVisible ( statWindow ) == false ) then 
         guiSetVisible(statWindow, true) 
         else 
         guiSetVisible(statWindow, false) 
         end 
         
    end) 
      
    

    I addedthis part

      
    if ( guiGetVisible ( statWindow ) == false ) then 
         guiSetVisible(statWindow, true) 
         else 
         guiSetVisible(statWindow, false) 
         end 
      
    

    But then it doesn't show at all :(

    Please help

  10. erroors :o

    serverside

      
    function greetingHandler ( message ) 
    account = getPlayerAccount(thePlayer) 
    local cash = getElementData ( account, "data.cash" ) 
    local deaths = getElementData ( account, "data.deaths" ) 
    local adminlevel = getElementData ( account, "data.adminlevel" ) 
    end 
    addEvent( "onGreeting", true ) 
    addEventHandler( "onGreeting", getRootElement(), greetingHandler ) 
      
    

    clientside

      
    function greetingCommand ( sourcePlayer,cmd,who,amount ) 
        triggerServerEvent ( "onGreeting", getLocalPlayer(), "Hello World!" )  
        account = getPlayerAccount(sourcePlayer) 
    if not isGuestAccount ( getPlayerAccount ( sourcePlayer ) ) then 
          
         
          
        outputChatBox ( "Money: ".. tostring( cash ) , sourcePlayer ) 
         outputChatBox ( "Deaths: ".. tostring( deaths ), sourcePlayer ) 
         outputChatBox ( "Adminlevel: ".. tostring( adminlevel ), sourcePlayer ) 
          
        end 
    end 
      
    addCommandHandler ( "greet", greetingCommand ) 
      
    

      
    [2011-03-09 16:39:03] WARNING: testmode\server.lua:146: Bad argument @ 'getPlayerAccount' 
    [2011-03-09 16:39:03] WARNING: testmode\server.lua:147: Bad argument @ 'getElementData' 
    [2011-03-09 16:39:03] WARNING: testmode\server.lua:148: Bad argument @ 'getElementData' 
    [2011-03-09 16:39:03] WARNING: testmode\server.lua:149: Bad argument @ 'getElementData' 
      
    

×
×
  • Create New...