ivor Posted July 2, 2018 Share Posted July 2, 2018 سلام عليكم , الحين انا مسوي هذا الكود يعطي لاعب فلوس عن طريق اسم الحساب ومسويها ع الاكس بي وشغاله انما الفلوس لا .. " بنفس الاكواد "َ هذا الكود + الدي بق مايقول انه في خطأ addEvent("SendGiftMoney", true) addEventHandler("SendGiftMoney", getRootElement(), function(acc, moneyPlayer) local Account = getAccount(acc) local thePlayer = getAccountPlayer (Account) if isElement(thePlayer) then if Account then setElementData(acc, "Money", (getElementData(acc, "Money")) + tonumber(moneyPlayer)) outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true) else outputChatBox("* Account did not exist !", source, 255, 0, 0) end end end ) Link to comment
Abdul KariM Posted July 2, 2018 Share Posted July 2, 2018 addEvent("SendGiftMoney", true) addEventHandler("SendGiftMoney", getRootElement(), function(acc, moneyPlayer) local Account = getAccount(acc) if not Account then return outputChatBox("* Account did not exist !", source, 255, 0, 0) end local thePlayer = getAccountPlayer (Account) if not thePlayer then outputChatBox ( "the player is offline" , source ) return end setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer)) outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true) end ) Link to comment
ivor Posted July 2, 2018 Author Share Posted July 2, 2018 10 minutes ago, Abdul KariM said: addEvent("SendGiftMoney", true) addEventHandler("SendGiftMoney", getRootElement(), function(acc, moneyPlayer) local Account = getAccount(acc) if not Account then return outputChatBox("* Account did not exist !", source, 255, 0, 0) end local thePlayer = getAccountPlayer (Account) if not thePlayer then outputChatBox ( "the player is offline" , source ) return end setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer)) outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true) end ) مايعطي فلوس يوم اضغط ع زر تسليم الجائزة , Link to comment
Abdul KariM Posted July 2, 2018 Share Posted July 2, 2018 (edited) moneyPlayer اي خطأ بالدي بوق ؟ + تأكد من المتغير ووش الرسالة الي تطلع لك بالشات ؟ Edited July 2, 2018 by Abdul KariM Link to comment
ivor Posted July 2, 2018 Author Share Posted July 2, 2018 Just now, Abdul KariM said: moneyPlayer اي خطأ بالدي بوق ؟ + تأكد من المتغير مافي اخطاء تطلع بالدي بق . Link to comment
Abdul KariM Posted July 2, 2018 Share Posted July 2, 2018 وش الرسالة الي تطلع بالشات ؟ Link to comment
ivor Posted July 2, 2018 Author Share Posted July 2, 2018 Just now, Abdul KariM said: وش الرسالة الي تطلع بالشات ؟ تم اعطاء اللاعب ivor الجائزة ولكن ماياخذ الفلوس بس ياخذ الاكس بي Link to comment
Abdul KariM Posted July 2, 2018 Share Posted July 2, 2018 addEvent("SendGiftMoney", true) addEventHandler("SendGiftMoney", getRootElement(), function(acc, moneyPlayer) outputChatBox ( tostring ( moneyPlayer ) ) local Account = getAccount(acc) if not Account then return outputChatBox("* Account did not exist !", source, 255, 0, 0) end local thePlayer = getAccountPlayer (Account) if not thePlayer then outputChatBox ( "the player is offline" , source ) return end setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer)) outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true) end ) جرب هذا وعطني وش يطلع لك بالشات Link to comment
ivor Posted July 2, 2018 Author Share Posted July 2, 2018 3 minutes ago, Abdul KariM said: addEvent("SendGiftMoney", true) addEventHandler("SendGiftMoney", getRootElement(), function(acc, moneyPlayer) outputChatBox ( tostring ( moneyPlayer ) ) local Account = getAccount(acc) if not Account then return outputChatBox("* Account did not exist !", source, 255, 0, 0) end local thePlayer = getAccountPlayer (Account) if not thePlayer then outputChatBox ( "the player is offline" , source ) return end setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer)) outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true) end ) جرب هذا وعطني وش يطلع لك بالشات مايطلع شي بالشات ولا يعطي فلوس الا لو حطيت قيمة الاكس بي يعطي اكس بي ويطلع بالشات فقط بس لما ما احط قيمة اكس بي يطلع هيك بالدي بق Error: GivePrizes\server.lua:17: attempt to compare nil with number ومايطلع شي بالشات Link to comment
ivor Posted July 2, 2018 Author Share Posted July 2, 2018 3 minutes ago, Abdul KariM said: المشكلة عندك بالكلينت يب طلعت بالكلينت , وشكرآ لمجهودك الرجاء الاغلاق - تم الحل Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now