but look, now.. i tried to make it if player has enough money to be able to buy a car.. now error says line 9 attempt to compare nil with number. cant understand...
carsTable = { [415] = 100, [413] = 50 }
carShopMarker = createMarker( -2424.12036, -609.69904, 131.62, "cylinder", 1.8, 130, 180, 0, 50 )
function buyCar(thePlayer, cmd, cmdType, carID)
if isElementWithinMarker(thePlayer, carShopMarker) and cmdType == "buy" then
if (carsTable[tonumber(carID)]) then
for i,v in pairs(carsTable) do
local playerMoney = getPlayerMoney(thePlayer)
if playerMoney > carsTable[v] then
outputChatBox("nigga got a car")
else
outputChatBox("bbz, arba ner pinige")
end
end
else
outputChatBox("Neteisingas Masinos ID", thePlayer)
end
end
end
addCommandHandler("v", buyCar)