MultiNo Posted August 17, 2014 Posted August 17, 2014 I do not know if this is possible, but how can I get my previous weapon and the next weapon? an example?
Max+ Posted August 17, 2014 Posted August 17, 2014 I do not know if this is possible, but how can I get my previous weapon and the next weapon? an example? 'press E and Q ' - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
MultiNo Posted August 17, 2014 Author Posted August 17, 2014 I wanted a function for this to create a HUD, just like this picture http://4.bp.blogspot.com/_zNnMHNDuLso/S ... 0/HUD1.jpg
Max+ Posted August 17, 2014 Posted August 17, 2014 I wanted a function for this to create a HUD, just like this picture http://4.bp.blogspot.com/_zNnMHNDuLso/S ... 0/HUD1.jpg getPedWeapon - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Anubhav Posted August 17, 2014 Posted August 17, 2014 Use the event onPlayerWeaponSwitch @ Max: It will only get the current weapon! Not previous . See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Max+ Posted August 17, 2014 Posted August 17, 2014 Use the event onPlayerWeaponSwitch @ Max: It will only get the current weapon! Not previous . Yeah , You'r Right , that event should do the job , - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
DNL291 Posted August 18, 2014 Posted August 18, 2014 "onPlayerWeaponSwitch" will not return the next weapon. You can use these functions: Client function getPreviousWeapon() local tempSlot = {} local curSlot = getPedWeaponSlot(localPlayer) if (curSlot == 0) and (getPedWeapon(localPlayer) == 0 or getPedWeapon(localPlayer) == 1) then curSlot = 13 end tempSlot["ID"] = 12 + 1 repeat tempSlot["ID"] = tempSlot["ID"]-1 until (tempSlot["ID"] < curSlot) and not (tempSlot["ID"] ~= 0 and getPedWeapon(localPlayer, tempSlot["ID"]) == 0) return getPedWeapon(localPlayer, tempSlot["ID"]) end function getNextWeapon() local tempSlot = {} local curSlot = getPedWeaponSlot(localPlayer) if (curSlot == 12) then curSlot = - 1 end tempSlot["ID"] = - 1 repeat tempSlot["ID"] = tempSlot["ID"] + 1 if tempSlot["ID"] == 13 then tempSlot["ID"] = -1 curSlot = -1 end until (tempSlot["ID"] > curSlot) and not (tempSlot["ID"] ~= 0 and getPedWeapon(localPlayer, tempSlot["ID"]) == 0) return getPedWeapon(localPlayer, tempSlot["ID"]) end I don't know if it's the best way to do that, but it should work without problems. Please do not PM me with scripting related question nor support, use the forums instead.
MultiNo Posted August 18, 2014 Author Posted August 18, 2014 Can anyone tell me how i can use dxDrawImage with this function (DNL291) for my hud please.
MultiNo Posted August 21, 2014 Author Posted August 21, 2014 I tried this but not working if ( 'getPreviousWeapon' == 1 ) then dxDrawImage ( x, y, x, y, "img/1.png" ) end
Castillo Posted August 21, 2014 Posted August 21, 2014 You aren't using it as a function. Replace: if ( 'getPreviousWeapon' == 1 ) then with: if ( getPreviousWeapon ( ) == 1 ) then San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
MultiNo Posted August 21, 2014 Author Posted August 21, 2014 (edited) Many thanks DNL291 and Solidsnake14 can close the topic. Edited September 10, 2014 by Guest
Castillo Posted August 21, 2014 Posted August 21, 2014 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
[UCG]Mike Posted August 22, 2014 Posted August 22, 2014 you can try with this too https://community.multitheftauto.com/ind ... ls&id=7275 You are now in Mark Zone !!!
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