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 ?

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

Try this:

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

I can map with any gamemode and do basic scripts :P

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Castiloo not cancel the Command i want he Take the frist greande and if he write gun dont take any weapon but grenade

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

NeverMined Thx For Help Me

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

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

I can map with any gamemode and do basic scripts :P

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...