icarus Posted September 2, 2012 Posted September 2, 2012 I made this but for idk why it doesnt work, it doesnt even output a debugscript message, can u help ? ---Clientside function reloadtazerclient () if getPedWeapon ( getLocalPlayer())== 23 then triggerServerEvent ("ontazershoot", getLocalPlayer()) end end addEventHandler ("onClientPedWeaponFire", getRootElement(), reloadtazerclient) ---Serverside addEvent ("ontazershoot", true) function tazershootserverside(sourcePlayer) reloadPedWeapon ( sourcePlayer ) end addEventHandler("ontazershoot", getRootElement(),tazershootserverside) (i already tryed "(source)" insted of "(sourcePlayer)", and "weapon == 23" insted of " getPedWeapon ( getLocalPlayer())== 23", and didnt work.
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 try this: http://pastebin.com/Ap5nZNy3 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
icarus Posted September 2, 2012 Author Posted September 2, 2012 still doesnt work ps:u can use ---this insted of pastbin
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 is there any errors? if there isn't try this: http://pastebin.com/gs4z1Yem (btw, sorry, I copy your script and edit them on PasteBin) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
icarus Posted September 2, 2012 Author Posted September 2, 2012 no, no errors, and still doesnt work, idk whats wrong with it.
Castillo Posted September 2, 2012 Posted September 2, 2012 That event is used for peds, you should use this one instead: onClientPlayerWeaponFire San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
icarus Posted September 2, 2012 Author Posted September 2, 2012 yeah lol, but still i changed that, in jay's version and my version, still doesnt work
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 try this: http://pastebin.com/pErrG6n1 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Castillo Posted September 2, 2012 Posted September 2, 2012 -- client side: function reloadtazerclient ( weapon ) if ( weapon == 23 ) then triggerServerEvent ( "ontazershoot", localPlayer ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, reloadtazerclient ) -- server side: function tazershootserverside ( ) reloadPedWeapon ( source ) end addEvent ( "ontazershoot", true ) addEventHandler ( "ontazershoot", root, tazershootserverside ) That should work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 Did anything got output to the chat box? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Castillo Posted September 2, 2012 Posted September 2, 2012 It's actually executing the function, but seems like it doesn't reload it at all. You can restrict the weapon clip amount to 1 with: setWeaponProperty. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
icarus Posted September 2, 2012 Author Posted September 2, 2012 yeah lol, this must be simplier, but still cant work with it ---clientside function tazerreload( startedRes ) setWeaponProperty ( 23, "maximum_clip_ammo", 1 ) end addEventHandler( "onClientResourceStart", getLocalPlayer( ),tazerreload)
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 (edited) actually, it's a resource, so try this: ---clientside function tazerreload( startedRes ) setWeaponProperty ("silenced_pistol" ,"poor", "maximum_clip_ammo", 1 ) end addEventHandler( "onResourceStart", resourceRoot,tazerreload) Edited September 2, 2012 by Guest My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
icarus Posted September 2, 2012 Author Posted September 2, 2012 still not working, omg, just a simple thing gives more work that a bunch of bigger things.
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 ok, I've edited it again, try now My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
icarus Posted September 2, 2012 Author Posted September 2, 2012 still not working DEBUGSCRIPT MESSAGE: ERROR:\client.lua:3:attempt to call global 'setWeaponPropriety' (a nil value)
Jaysds1 Posted September 2, 2012 Posted September 2, 2012 oh I found the reason why, it's server sided, btw try the code again. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
icarus Posted September 2, 2012 Author Posted September 2, 2012 this time there is no Debugmessage and still not working
Entity Posted September 2, 2012 Posted September 2, 2012 Server: function tazerreload( startedRes ) setWeaponProperty ( 23, "poor", "maximum_clip_ammo", 1 ) setWeaponProperty ( 23, "std", "maximum_clip_ammo", 1 ) setWeaponProperty ( 23, "pro", "maximum_clip_ammo", 1 ) end addEventHandler( "onResourceStart", resourceRoot,tazerreload)
icarus Posted September 2, 2012 Author Posted September 2, 2012 lol, thanks works, i tryed this but only in "poor" mode maybe thats why it didnt work, thanks
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