3ssol Posted September 20, 2013 Share Posted September 20, 2013 Slam 3lekm شباب ابي اسوي كذا addCommandHandler لما تكتب الامر مرتين تشتغل وضيفه من عندي اسويها فهمتوني؟ يعني اكتبها مره وحده مايصير شي تكتبها مره ثانيه تصير وضيفه انا مسويها وشكرا Link to comment
xFace[B]ook Posted September 20, 2013 Share Posted September 20, 2013 addCommandHandler(... ) function () وهنا حط الخرابيط حقك ذذ Link to comment
|Mr|-Talal07-| Posted September 20, 2013 Share Posted September 20, 2013 count = {} addCommandHandler("test", function (player) if count[player] then givePlayerMoney(player,100) -- your function count[player] = false else count[player] = true end end ) Link to comment
3ssol Posted September 20, 2013 Author Share Posted September 20, 2013 كفوو طلال ولكن عندي سوال لو بخلي تكتب الامر 3 مرات او 4 كيف؟ Link to comment
jafar Posted September 20, 2013 Share Posted September 20, 2013 local count = 0 addCommandHandler("test", function (player) if count <= 3 then givePlayerMoney(player,100) -- your function count = 0 else count = count +1 end end ) Link to comment
3NAD Posted September 20, 2013 Share Posted September 20, 2013 ^ طريقتك صحيحة ولكن بما انها بـ جانب السيرفر راح يتعارض مع اللاعبين count فـ مثلاً انا كتبت الكلمة رايح يزيد واحد لـ المتغير count وانت كتبت الكلمة راح يزيد واحد لـ المتغير فـ الأفضل استخدام الجدول بـ جانب السيرفر Link to comment
|Mr|-Talal07-| Posted September 20, 2013 Share Posted September 20, 2013 (edited) num = 4 -- max count count = {} addCommandHandler("test", function (player) if count[player] == num then givePlayerMoney(player,100) -- your function count[player] = 0 else count[player] = count[player] + 1 end end ) addEventHandler("onPlayerJoin",root, function () count[source] = 0 end ) Edited September 21, 2013 by Guest Link to comment
3ssol Posted September 20, 2013 Author Share Posted September 20, 2013 (edited) اخوي طلال ماضبط كتبتها 4 مرات ماصار اي شي edit : up up Edited September 21, 2013 by Guest Link to comment
PaiN^ Posted September 20, 2013 Share Posted September 20, 2013 @ |Mr|-Talal07-| : عندك خطأ في سطر 17 @ 3ssol : جرب ذا الكود local num = 4 -- max count local count = { } addEventHandler( "onResourceStart", resourceRoot, function( ) for _,player in ipairs( getElementsByType( "player" ) ) do count[player] = 0 end end ) addEventHandler( "onPlayerJoin", root, function( ) count[source] = 0 end ) addCommandHandler( "test", function( player ) count[player] = count[player] + 1 if count[player] >= num then givePlayerMoney( player, 100 ) -- your function count[player] = 0 end end ) Link to comment
3ssol Posted September 20, 2013 Author Share Posted September 20, 2013 شكرا بين ضبببط تسلم وشكرا لكل من شاارك Link to comment
|Mr|-Talal07-| Posted September 21, 2013 Share Posted September 21, 2013 @ |Mr|-Talal07-| : عندك خطأ في سطر 17@ 3ssol : جرب ذا الكود local num = 4 -- max count local count = { } addEventHandler( "onResourceStart", resourceRoot, function( ) for _,player in ipairs( getElementsByType( "player" ) ) do count[player] = 0 end end ) addEventHandler( "onPlayerJoin", root, function( ) count[source] = 0 end ) addCommandHandler( "test", function( player ) count[player] = count[player] + 1 if count[player] >= num then givePlayerMoney( player, 100 ) -- your function count[player] = 0 end end ) والله ما ادري وش يبي فيه اكتب كومند 4 مرات وش ابي به ضض 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