Jump to content

Bug with giveWeapon


Recommended Posts

Hi, I have big problem with this code:

client-side:

triggerServerEvent("giveWeaponOnSpawn", getLocalPlayer()) 

server-side:

function giveWeaponOnSpawn() 
    outputChatBox("You have minigun!", source) 
    if (giveWeapon(source, 38, 999, true) == true) then 
        outputChatBox("succesfully", source) 
    else 
        outputChatBox("not succesfully", source) 
    end 
end 
addEvent("giveWeaponOnSpawn", true) 
addEventHandler("giveWeaponOnSpawn", getRootElement(), giveWeaponOnSpawn) 

And on chat I have:

"You have minigun!"

"succesfully"

but I don't have a minigun :( Help, please.

Link to comment

try this

Server Side :

function giveWeaponOnSpawn() 
 giveWeapon( source, 38, 999, true ) 
  outputChatBox( "You have minigun!", source ) 
    outputChatBox("succesfully") 
    else 
    outputChatBox("not succesfully") 
end 
addEvent("giveWeaponOnSpawn", true) 
addEventHandler("giveWeaponOnSpawn", getRootElement(), giveWeaponOnSpawn) 

Link to comment

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