Al3grab Posted August 21, 2011 Posted August 21, 2011 Hi. i made Super Bullets in shop ,, when the player buy it he have Explosive Bullets .. now the super bullets work .. but i want to put a time that super bullets end .. i tried ' setTimer ' function but didnt work ' maybe i didnt made it right ' .. so i need help in this the code [ client-side ] local PlayerMoney = getPlayerMoney() if ( PlayerMoney > 10000 ) then takePlayerMoney(10000) outputChatBox("You Bought Super Bullets By 10000$",source,255,255,0) function superBullet(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if ( weapon == 24) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 23) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 22) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 31) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 30) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 32) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 29) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 28) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 33) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 34) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 25) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end end addEventHandler("onClientPlayerWeaponFire", root, superBullet) else outputChatBox("You Dont Have Enough Money 10000$",source,255,0,0) end p.s : " Don't give me a fish, teach me how to Catch it ! " ING : [xXx]~Al3grab
Try Posted August 21, 2011 Posted August 21, 2011 Hellllooooooooo 1º Use tigger Client: local PlayerMoney = getPlayerMoney() if ( PlayerMoney > 10000 ) then takePlayerMoney(10000) outputChatBox("You Bought Super Bullets By 10000$",source,255,255,0) function superBullet(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if ( weapon == 24) then tiggerServerEvent(source,"bum",source) end if ( weapon == 23) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 22) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 31) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 30) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 32) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 29) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 28) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 33) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 34) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end if ( weapon == 25) then createExplosion(hitX, hitY, hitZ, 6, true, false, true) end end addEventHandler("onClientPlayerWeaponFire", root, superBullet) else outputChatBox("You Dont Have Enough Money 10000$",source,255,0,0) end Server: function bulletbum(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) setTimer(createExplosion,2000,1,hitX, hitY, hitZ, 6, true, false, true) end addEvent("bum",true) addEventHandler("bum",getRootElement(),bulletbum) It should work I wont give all the code cuz like how u said Don't give me a fish, teach me how to Catch it !
Al3grab Posted August 21, 2011 Author Posted August 21, 2011 Try : thx for ur post .. but it didnt work .. and you didnt teached me how to catch you just gave me half fish ING : [xXx]~Al3grab
Al3grab Posted August 21, 2011 Author Posted August 21, 2011 Hi , after i did some search in the forum ,i made a code and now it works , the code do : set Timer to remove Event Handler of the superBullets wich is "onClientWeaponFire" ,, the code : setTimer(function () removeEventHandler("onClientPlayerWeaponFire", root, superBullet) outputChatBox("Super Bullets Has End",255,255,0) end,20000,1, true) 20000 = 20 sec ' for test ' thanks ' Try ' for helping .. but ur fish didnt worked : p ING : [xXx]~Al3grab
Try Posted August 22, 2011 Posted August 22, 2011 Please Wont Double post! You are warned! ------ WTF F*ck you FISH but with the tigger (if u do correct more than i did [i can do this work]) it will work too
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