CarpeDiem Posted June 16, 2016 Share Posted June 16, 2016 Debugscript, no warning, no error. Not an error but does not work. addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientGUIClick", SoyguncuButon, Soygun, false) end) function Soygun(thePlayer,localPlayer) if not getPedWeapon(localPlayer) then givePedWeapon(thePlayer,31,200,true) end end Link to comment
Dimos7 Posted June 16, 2016 Share Posted June 16, 2016 addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientGUIClick", SoyguncuButon, Soygun, false) end) function Soygun() if not getPedWeapon(localPlayer) then givePedWeapon(localPlayer,31,200,true) end end Link to comment
Dimos7 Posted June 16, 2016 Share Posted June 16, 2016 any debug warning or error? in meta that file need by type="client" Link to comment
CarpeDiem Posted June 16, 2016 Author Share Posted June 16, 2016 No error, no warning. yes type="client" Link to comment
bebo1king Posted June 16, 2016 Share Posted June 16, 2016 addEventHandler("onClientGUIClick", SoyguncuButon, Soygun, function Soygun() if not getPedWeapon(localPlayer,getSlotFromWeapon(31)) then givePedWeapon(localPlayer,31,200,true) end end) Link to comment
CarpeDiem Posted June 16, 2016 Author Share Posted June 16, 2016 Does not that help others? Link to comment
CarpeDiem Posted June 16, 2016 Author Share Posted June 16, 2016 (edited) a Edited June 16, 2016 by Guest Link to comment
KariiiM Posted June 16, 2016 Share Posted June 16, 2016 Your main mistake is you used the function givePedWeapon to the localPlayer while this function works only for peds. Link to comment
CarpeDiem Posted June 16, 2016 Author Share Posted June 16, 2016 Which employees for players ? Link to comment
KariiiM Posted June 16, 2016 Share Posted June 16, 2016 Which employees for players ? giveWeapon does, but it's server sided Link to comment
CarpeDiem Posted June 16, 2016 Author Share Posted June 16, 2016 addEvent("silahver", true ) addEventHandler("silahver", root, function() giveWeapon(source, 31, 200 ,true) end) If this code works when I want m4a player . how can I do it ? Link to comment
KariiiM Posted June 16, 2016 Share Posted June 16, 2016 Put this code in server side; addEvent ( "silahver", true ) addEventHandler ( "silahver", root, function ( ) setElementPosition ( client, 442, -1312, 15.5 ) giveWeapon ( client, 31, 200 ,true ) end ) go to client side and modify the Soygun function by this function: function Soygun ( ) triggerServerEvent ( "silahver", localPlayer ) end Link to comment
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