Jump to content

Pickuup problem again


bartje01

Recommended Posts

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]

Link to comment

I think it can help:

  
function armourBlock(pickup,dimension) 
local thePlayer = source 
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) 
  

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...