CarpeDiem Posted June 16, 2016 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
Dimos7 Posted June 16, 2016 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
Dimos7 Posted June 16, 2016 Posted June 16, 2016 any debug warning or error? in meta that file need by type="client"
bebo1king Posted June 16, 2016 Posted June 16, 2016 addEventHandler("onClientGUIClick", SoyguncuButon, Soygun, function Soygun() if not getPedWeapon(localPlayer,getSlotFromWeapon(31)) then givePedWeapon(localPlayer,31,200,true) end end)
KariiiM Posted June 16, 2016 Posted June 16, 2016 Your main mistake is you used the function givePedWeapon to the localPlayer while this function works only for peds.
KariiiM Posted June 16, 2016 Posted June 16, 2016 Which employees for players ? giveWeapon does, but it's server sided
CarpeDiem Posted June 16, 2016 Author 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 ?
KariiiM Posted June 16, 2016 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
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