Jump to content

تصحيح اكواد


Recommended Posts

السلام عليكم و رحمة الله وبركاتة

في كود جنني انه في اخطاء في الدي بق لاكن المود شغال 100% مش عارف في اية

اول خطا

p_561e5ttt1.png

addEvent("putData",true)
addEventHandler("putData",root,
function (Name,Price)
guiSetText(Label1,"[ "..Name.." ]")
guiSetText(Label2,"[ "..Price.."$ ]")
end
)

 

السطر

guiSetText(StockPriceLabel,"[ "..Price.."$ ]")

الخطا الثاني

 

setTimer(
function()
for index, thePlayer in ipairs(getElementsByType("player"))do 
local Acc = getPlayerAccount ( thePlayer )
if ( Acc ) and not isGuestAccount ( Acc ) then 
local Price = getAccountData ( Acc, "DataName" ,Price)
setAccountData(Acc,"DataName",tonumber(Price)-1) 
triggerClientEvent(thePlayer,"PutNewData",thePlayer,Price)
end
end
end, 3000, 0)

 

جميع الاكواد سليمة و تعمل بنجاح لاكن اكواد الدي بق تعمل لاق
[04:02:28] ERROR: Script\s.lua:88: attempt to perform arithmetic on a nil value

 

 

Link to comment

الخطأ الاول يقولك القيمة بولين يعني فولس او ترو مايصير تحطها بدون سترنق باليبل

الخطأ الثاني بدل السطر هذا بالي عندك

local Price = getAccountData ( Acc, "DataName" ) or 0

 

Edited by Abdul KariM
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...