-#Saimon Posted July 17, 2015 Share Posted July 17, 2015 function dxdraw() dxDrawText ("U have Receive new gift" ,"left","top") end addCommandHandler ("Gift", function () for _,v in ipairs (getElementsByType("player")) do local Money = math.random ( 1000, 5000 ) givePlayerMoney (v, Money) setElementHealth (v, 100) setPedArmor (v, 100) addEventHandler("onClientRender" ,resourceRoot,dxdraw ) setTimer(function () removeEventHandler("onClientRender" ,resourceRoot,dxdraw ) end, 8000, 1 ) end end) الكود سيرفر , والتيكست كلينت , ماينفع تدمجهم مع بعض , استخدم الترايقر Link to comment
Mr.R Posted July 17, 2015 Share Posted July 17, 2015 (edited) ماقصرتو بس هذي الاكواد الصحيحه Server Side addCommandHandler ( "Gift", function ( ) for _,v in ipairs ( getElementsByType ( "player" ) ) do local Money = math.random ( 1000, 5000 ) givePlayerMoney ( v, Money ) setElementHealth ( v, 100 ) setPedArmor ( v, 100 ) triggerClientEvent ( v, "DrawText", v ) end end ) Client Side local screenW, screenH = guiGetScreenSize ( ) function dxDraw ( ) dxDrawText("تم اعطائك واعطاء جميع الاعبين هديه : )", (screenW - 574) / 2, (screenH - 111) / 2, ((screenW - 574) / 2) + 574, ( (screenH - 111) / 2) + 111, tocolor(26, 225, 0, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) end addEvent ( "DrawText", true ) addEventHandler ( "DrawText", root, function ( ) addEventHandler ( "onClientRender", resourceRoot, dxDraw ) setTimer ( function ( ) removeEventHandler ( "onClientRender", resourceRoot, dxDraw ) end, 8000, 1 ) end ) Edited July 18, 2015 by Guest Link to comment
#|_oskar_|# Posted July 17, 2015 Share Posted July 17, 2015 function dxdraw() dxDrawText ("U have Receive new gift" ,"left","top") end addCommandHandler ("Gift", function () for _,v in ipairs (getElementsByType("player")) do local Money = math.random ( 1000, 5000 ) givePlayerMoney (v, Money) setElementHealth (v, 100) setPedArmor (v, 100) addEventHandler("onClientRender" ,resourceRoot,dxdraw ) setTimer(function () removeEventHandler("onClientRender" ,resourceRoot,dxdraw ) end, 8000, 1 ) end end) الكود سيرفر , والتيكست كلينت , ماينفع تدمجهم مع بعض , استخدم الترايقر كنت اوضح له شئ محدد + مشكور ع التنبيه 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