Jump to content

Hey can i get Some Help ?


Evil-Cod3r

Recommended Posts

Posted

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 ?

Posted

Try this:

addEventHandler("onPlayerCommand", root, 
function (command) 
    if (command == "gun") then 
         cancelEvent() 
    end 
end) 

Posted (edited)

You should atleast give a try by yourself, no one here will make scripts for you.(unless they are too nice :P)

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 by Guest
Posted

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.

Posted

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.

Posted
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...