Jump to content

onPlayerWeaponSwitch doesn't trigger.


Tuna

Recommended Posts

Posted

After debugging a simple script to find out the event didn't even work I have found that onPlayerWeaponSwitch does not work. It is only triggering when a player is given a weapon.

Since there is no bug tracker I'll post here.

  
function onSwitch(prev, new) 
      outputChatBox(tostring(prev).." "..tostring(new).." "..getPlayerName(source), root, 255, 255, 0) 
end 
addEventHandler("onPlayerWeaponSwitch", root, onSwitch) 
  

Nobody on the server was triggering it, only when weapons were being given to people.

Server Version: 1.0.4-release-1963

Posted

Thats not the point, if an event does not work it should be removed or fixed.

Edit: and yet another function that is failing server side: isElementInWater. Ran a for loop isElementInWater (vehicles) got no returns, run it client side and got 2. There were players stood around the vehicle in the water so it can't have been that somebody had to stream it for the server side one to work.

Posted

hmm, lets wait to bugtracker comes back online..

and treat Spider Pork's reply as workaround not solution :)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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