Evil-Cod3r Posted February 6, 2012 Posted February 6, 2012 Hi iam trying to Make a script Anti-Gun Command if you all remmebr BaseMode if Player throw his greande and write gun in f8 he select his weapons and get another greande can some one give me the commands and event or example to Make anti-gun for that ?
Castillo Posted February 6, 2012 Posted February 6, 2012 Try this: addEventHandler("onPlayerCommand", root, function (command) if (command == "gun") then cancelEvent() end end)
sora+ Posted February 6, 2012 Posted February 6, 2012 (edited) You should atleast give a try by yourself, no one here will make scripts for you.(unless they are too nice ) Use https://wiki.multitheftauto.com/wiki/GetPedWeapon -- For getting the local weapon https://wiki.multitheftauto.com/wiki/TakeWeapon -- To remove the weapon https://wiki.multitheftauto.com/wiki/AddCommandHandler -- To have a cmd for it. https://wiki.multitheftauto.com/wiki/BindKey -- To bind a key for the cmd. This function will remove a grenade if g is pressed. function removeit() Androm = getLocalPlayer() takeWeapon (Androm,16) end addCommandHandler ( "grenade", removeit ) bindKey("grenade","down"g") i hope thats what you were looking for , i seriously didn't understand what you ment. Edited February 6, 2012 by Guest
Castillo Posted February 6, 2012 Posted February 6, 2012 The function: takeWeapon is server side, and getLocalPlayer() is client side only. P.S: That's not the right way to use bindKey in a server side.
Evil-Cod3r Posted February 6, 2012 Author Posted February 6, 2012 Castiloo not cancel the Command i want he Take the frist greande and if he write gun dont take any weapon but grenade
Castillo Posted February 6, 2012 Posted February 6, 2012 Well, then you should learn English, because what I understood was that you wanted to make a script to stop player's from getting grenades by "/gun". I don't know much about Basemode either.
sora+ Posted February 6, 2012 Posted February 6, 2012 The function: takeWeapon is server side, and getLocalPlayer() is client side only. P.S: That's not the right way to use bindKey in a server side. My bad , didn't notice the client-only and server-only thingy. Anyways , you can still use triggerServerEvent @ topic starter
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