hassan.k.s.a Posted July 10, 2012 Share Posted July 10, 2012 (edited) &* Edited March 25, 2013 by Guest Link to comment
top sniper Posted July 10, 2012 Share Posted July 10, 2012 client addEventHandler ("onClientGUIClick", getRootElement(), function() if ( source == speed ) then triggerServerEvent("setPlayerSpeed",getLocalPlayer ( )) setGameSpeed ( 10 ) end end ) server addEvent("setPlayerSpeed",true) addEventHandler("setPlayerSpeed",root, function() if getPlayerMoney (source) >= 2000 then takePlayerMoney(source, 2000) outputChatBox(getPlayerName(source).." #ffff00Has Bought #00ffff[speed]",root,255,0,0,true) else outputChatBox("#00cc00You don't have #ff0000$2000 #00cc00to buy #ffff00[speed]",source,255,0,0,true) end end) Link to comment
X-SHADOW Posted July 10, 2012 Share Posted July 10, 2012 This is Better Code and orgnized .. --ClientSide addEventHandler('onClientGUIClick' ,root, function() if ( source == speed ) then triggerServerEvent('setPlayerSpeed', localPlayer) setGameSpeed( 10) end end ) -ServerSide addEvent("setPlayerSpeed",true) addEventHandler("setPlayerSpeed",root, function() if (getPlayerMoney (source) >= 2000) then takePlayerMoney(source, 2000) outputChatBox(getPlayerName(source).." #ffff00Has Bought #00ffff[speed]",root,255,0,0,true) else outputChatBox("#00cc00You don't have #ff0000$2000 #00cc00to buy #ffff00[speed]",source,255,0,0,true) end end) Link to comment
hassan.k.s.a Posted July 10, 2012 Author Share Posted July 10, 2012 (edited) &* Edited March 25, 2013 by Guest Link to comment
hassan.k.s.a Posted July 10, 2012 Author Share Posted July 10, 2012 (edited) * Edited March 25, 2013 by Guest Link to comment
top sniper Posted July 11, 2012 Share Posted July 11, 2012 hassan.k.s.a said: طيب ذا الكود كمان فيه مشكله--cilent side-- function xxx(button, state, absoluteX, absoluteY) if ( source == SuperBullet ) then triggerServerEvent("SuperBullet",getLocalPlayer()) end addEventHandler ("onClientGUIClick", getRootElement(), xxx) ------------------------------------------------------------------------- addEvent("sumolet",true) function sumolet (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if ( weapon == 24) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 23) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 22) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 31) then triggerServerEvent ("shonet" ,localPlayer, hitX, hitY, hitZ ) end if ( weapon == 30) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 32) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 29) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 28) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 33) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 34) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 25) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end end addEventHandler ("onClientPlayerWeaponFire",localPlayer, sumolet) addEventHandler("sumolet",getRootElement(),sumolet) --server side-- addEvent("SuperBullet",true) function SuperBullet() local playerMoney = getPlayerMoney(source) if playerMoney >= 3000 then takePlayerMoney (source,3000) local name = getPlayerName(source) outputChatBox("* [#000011 " .. name .. "#ff0000 ]#0099ff Has Bought#ff0000 [#000011 SuperBullet#ff0000 ]",getRootElement(),255,0,0,true) triggerClientEvent ("sumolet" ,getRootElement()) elseif playerMoney <= 3000 then outputChatBox("* you Don't have enough Money !",source,255,0,0,true) end end addEventHandler("SuperBullet",getRootElement(),SuperBullet) ------------------------------------------------------------------------------ addEvent("shonet", true) addEventHandler("shonet", getRootElement(), function(l_6_0, l_6_1, l_6_2) createExplosion(l_6_0, l_6_1, l_6_2, 11, source, true, false, true) end ) وشكرا *__& كودك هريسة واحلى ما فيه انة مفكوك l_6_0, ه1 Link to comment
hassan.k.s.a Posted July 11, 2012 Author Share Posted July 11, 2012 (edited) * Edited March 25, 2013 by Guest Link to comment
top sniper Posted July 11, 2012 Share Posted July 11, 2012 hassan.k.s.a said: ههههههههههههههههههههههطيب جيب من عندك كود *___^ اذا ماعليك آمر انا تعبت ماقدرت تكفى كلنت function sumolet1 (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if ( weapon == 24) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 23) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 22) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 31) then triggerServerEvent ("shonet" ,localPlayer, hitX, hitY, hitZ ) end if ( weapon == 30) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 32) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 29) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 28) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 33) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 34) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end if ( weapon == 25) then triggerServerEvent ("shonet" ,getLocalPlayer(), hitX, hitY, hitZ ) end end addEvent("sumolet",true) function sumolet () addEventHandler ("onClientPlayerWeaponFire",getLocalPlayer(), sumolet1) end addEventHandler("sumolet",getRootElement(),sumolet) server addEvent("shonet", true) addEventHandler("shonet", getRootElement(), function(hitX, hitY, hitZ) createExplosion(hitX, hitY, hitZ,4, source) end ) طبعا انا خليت النوع 4 والى هو انفجار سيارة تقدر تعدل الرقم وهذي الاررقام والانفجارات الى تسويها 0: Grenade 1: Molotov 2: Rocket 3: Rocket Weak 4: Car 5: Car Quick 6: Boat 7: Heli 8: Mine 9: Object 10: Tank Grenade 11: Small 12: Tiny Link to comment
hassan.k.s.a Posted July 11, 2012 Author Share Posted July 11, 2012 (edited) * Edited March 25, 2013 by Guest Link to comment
hassan.k.s.a Posted July 11, 2012 Author Share Posted July 11, 2012 (edited) * Edited March 25, 2013 by Guest Link to comment
top sniper Posted July 12, 2012 Share Posted July 12, 2012 hassan.k.s.a said: وياريت تضيف السعر معه ولو ماتبي خلاص جيب الكود لحاله لاكن شوف لي حل حطيت بدل 4 حطيت 2 *__^ addEvent("SuperBullet",true) function SuperBullet() local playerMoney = getPlayerMoney(source) if playerMoney >= 3000 then takePlayerMoney (source,3000) local name = getPlayerName(source) outputChatBox("* [#000011 " .. name .. "#ff0000 ]#0099ff Has Bought#ff0000 [#000011 SuperBullet#ff0000 ]",getRootElement(),255,0,0,true) triggerClientEvent ("sumolet" ,getRootElement()) else outputChatBox("* you Don't have enough Money !",source,255,0,0,true) end end addEventHandler("SuperBullet",getRootElement(),SuperBullet) Link to comment
top sniper Posted July 12, 2012 Share Posted July 12, 2012 hassan.k.s.a said: وياريت تضيف السعر معه ولو ماتبي خلاص جيب الكود لحاله لاكن شوف لي حل حطيت بدل 4 حطيت 2 *__^ addEvent("SuperBullet",true) function SuperBullet() local playerMoney = getPlayerMoney(source) if playerMoney >= 3000 then takePlayerMoney (source,3000) local name = getPlayerName(source) outputChatBox("* [#000011 " .. name .. "#ff0000 ]#0099ff Has Bought#ff0000 [#000011 SuperBullet#ff0000 ]",getRootElement(),255,0,0,true) triggerClientEvent ("sumolet" ,getRootElement()) else outputChatBox("* you Don't have enough Money !",source,255,0,0,true) end end addEventHandler("SuperBullet",getRootElement(),SuperBullet) 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