Almeidowski Posted August 28, 2020 Posted August 28, 2020 Hello, I'm trying to create a command that gives me a weapon I typed with the number of bullets I typed. For example: /weapon weapon_pistol 1000 This command gives me a pistol with a 1000 guns. I've tried addCommand ('weapon', (player, weapon, bullets), but it doesn't work. I know how to do this in lua, but not on JS. Thanks in advance.
Floriian Posted August 29, 2020 Posted August 29, 2020 mp.events.addCommand("mute", (player, _, target, ...reason) => { if(player.admin >= 3) { let newTarget = functions.functions.findPlayerByIdOrNickname(target); console.log(newTarget); let newReason = reason.join(' '); if(target == null) return player.outputChatBox(`!{32a852}[USAGE]: !{ffffff} /mute [Player] [Reason]`); if(newTarget.muted === false) { if(reason == null) return player.outputChatBox(`!{32a852}[USAGE]: !{ffffff} /mute [Player] [Reason]`); newTarget.muted = true; player.outputChatBox(`!{b82e2e}[ADMIN]: ${newTarget.name} muted!`); newTarget.outputChatBox(`!{b82e2e}[ADMIN]: Muted by ${player.name} Reason: ${newReason}`); } else { newTarget.muted = false; newTarget.outputChatBox(`!{b82e2e}[ADMIN]: unmuted.`); } } else { player.outputChatBox(`!{b82e2e}You are not admin!`); } }); For example: 1
MrPancakers Posted August 29, 2020 Posted August 29, 2020 Funny enough the page about making commands has an example you need. https://wiki.rage.mp/index.php?title=Events::addCommand Please read this especially the Handler function parameter and you'll see why yours doesn't work. Don't leave the page until you understand it 1
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