Khalil Posted August 22, 2013 Posted August 22, 2013 function playerPing (thePlayer) if getPlayerPing ( thePlayer ) >= 900 then outputChatBox ( "Your ping is above 900, you may not use weapons until your ping is lowered", thePlayer, 255, 0, 0 ) end end function wepSwitch (thePlayer) setPlayerWeaponSlot ( thePlayer, 0 ) end addEventHandler ( "onPlayerWeaponSwitch", root, wepSwitch ) Level 3 admin on RRC:RPG.
Castillo Posted August 22, 2013 Posted August 22, 2013 Well, firstly, "onPlayerWeaponSwitch" uses "source", the two arguments are the previous and the current weapon, second, you made two functions, one which is not connected to the other in any way, so it's not going to work. function playerPing ( ) if ( getPlayerPing ( source ) >= 900 ) then outputChatBox ( "Your ping is above 900, you may not use weapons until your ping is lowered", source, 255, 0, 0 ) setPedWeaponSlot ( source, 0 ) end end addEventHandler ( "onPlayerWeaponSwitch", root, playerPing ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Khalil Posted August 22, 2013 Author Posted August 22, 2013 But, will that player be able to switch weapons? Level 3 admin on RRC:RPG.
Castillo Posted August 22, 2013 Posted August 22, 2013 With my code it'll always switch back to fist ( 0 ) if the ping is 900 or higher. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Khalil Posted August 22, 2013 Author Posted August 22, 2013 Alright, thanks. Level 3 admin on RRC:RPG.
Castillo Posted August 22, 2013 Posted August 22, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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