Jump to content

command handler problem


MAB

Recommended Posts

ERROR: RC\server.lua:37: attempt to call global 'getElementInerior' (a nil value)

function challange (challanger,commandName,player2,money) -- making the challanging function 
if ( getElementInerior(challanger) == 11 ) then 
local bet = tonumber(money) 
local challanged = getPlayerFromName(player2) 
if not money or not player2 then 
outputChatBox("Correct Sync for challange is /challange .",challanger,0,255,0) 
end 
if not bet then 
outputChatBox("Invalid amount.",challanger,0,255,0) 
end 
if not challanged then 
outputChatBox("Can't find a player with that name.",challanger,0,255,0) 
end 
if ( challanged and bet ) then 
setElementData(challanged,"challanger",getAccountName(getPlayerAccount(chaallanger))) 
end 
end 
end 
addCommandHandler("challange",challange) 

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