CodX Posted November 16, 2017 Share Posted November 16, 2017 (edited) Hello ! I try to make a script who give a minigun with 1000 ammo but when i execute the command he give me minigun if one ammo. I'm sorry for my english, i'm from Romanian and the text is the same. function vreau (thePlayer, commandName, weaponID, ammo) if (exports.integration:isPlayerLeadAdmin(thePlayer) or exports.integration:isPlayerLeadScripter(thePlayer)) then outputChatBox ("Ai primit 1 minigun cu 1000 de gloante.", source, 255, 255 ,0) giveWeapon (thePlayer, 38, 500) setWeaponAmmo (thePlayer, 38, 500) end end addCommandHandler ("give", vreau) Meta: <meta> <script src="script.lua" type="server" /> <script src="script.lua" type="client" /> </meta> Edited November 16, 2017 by CodX Link to comment
Moderators IIYAMA Posted November 16, 2017 Moderators Share Posted November 16, 2017 (edited) I don't understand your question, please rewrite last part. Not required: setWeaponAmmo (thePlayer, 38, 500) Change: giveWeapon (thePlayer, 38, 1000, true) Adding the script to two sides is not correct, unless you know what you are doing. <meta> <script src="script.lua" type="server" /> <!--<script src="script.lua" type="client" />--> </meta> Edited November 16, 2017 by IIYAMA Link to comment
itHyperoX Posted November 16, 2017 Share Posted November 16, 2017 addCommandHandler("giveweapon",function(player, weapon, ammo) if (exports.integration:isPlayerLeadAdmin(player) or exports.integration:isPlayerLeadScripter(player)) then if weapon then if tonumber(ammo) then giveWeapon(player, weapon, ammo) end end end end) Link to comment
CodX Posted November 17, 2017 Author Share Posted November 17, 2017 (edited) 8 hours ago, TheMOG said: addCommandHandler("giveweapon",function(player, weapon, ammo) if (exports.integration:isPlayerLeadAdmin(player) or exports.integration:isPlayerLeadScripter(player)) then if weapon then if tonumber(ammo) then giveWeapon(player, weapon, ammo) end end end end) Don't work, is the same, he give me only one bullet. He says: You have been given a 'Minigun'(500) by Vladus_Griffin. =================================================================================================================================== 10 hours ago, IIYAMA said: I don't understand your question, please rewrite last part. Not required: setWeaponAmmo (thePlayer, 38, 500) Change: giveWeapon (thePlayer, 38, 1000, true) Adding the script to two sides is not correct, unless you know what you are doing. <meta> <script src="script.lua" type="server" /> <!--<script src="script.lua" type="client" />--> </meta> I change the script but is the same problem. function vreau (thePlayer, commandName, weaponID, ammo) if (exports.integration:isPlayerLeadAdmin(thePlayer) or exports.integration:isPlayerLeadScripter(thePlayer)) then outputChatBox ("Ai primit 1 minigun cu 500 gloante.", thePlayer, 255, 255 ,0) giveWeapon (thePlayer, 38, 500, true) end end addCommandHandler ("give", vreau) Edited November 17, 2017 by CodX Link to comment
Moderators IIYAMA Posted November 17, 2017 Moderators Share Posted November 17, 2017 But what is the problem? I don't know what to look for. Link to comment
CodX Posted November 17, 2017 Author Share Posted November 17, 2017 5 minutes ago, IIYAMA said: But what is the problem? I don't know what to look for. So, when I execute the command he give me the weapon. minigun, but that weapon contains only one bullet and, from script, he need to give me 500 bullets. Link to comment
Moderators IIYAMA Posted November 17, 2017 Moderators Share Posted November 17, 2017 (edited) You sure you don't run a gamemode with anti cheat next to it? And you aren't trying to give the weapon clientside? Edited November 17, 2017 by IIYAMA Link to comment
CodX Posted November 17, 2017 Author Share Posted November 17, 2017 The gamemode is RolePlay but I do not think she's stuck. Link to comment
Moderators IIYAMA Posted November 17, 2017 Moderators Share Posted November 17, 2017 Try to run the play gamemode instead of roleplay and test the script. Most roleplay gamemodes do have anti weapon cheat. Link to comment
CodX Posted November 17, 2017 Author Share Posted November 17, 2017 35 minutes ago, IIYAMA said: Try to run the play gamemode instead of roleplay and test the script. Most roleplay gamemodes do have anti weapon cheat. In map editor on "Full Test Mode" it work. Link to comment
CodX Posted November 17, 2017 Author Share Posted November 17, 2017 1 hour ago, IIYAMA said: You sure you don't run a gamemode with anti cheat next to it? And you aren't trying to give the weapon clientside? Meta: <meta> <script src="script.lua" type="server" /> </meta> Link to comment
Moderators IIYAMA Posted November 17, 2017 Moderators Share Posted November 17, 2017 Then it must be roleplay anticheat. 1 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