Adjusting Ammo

Installation support, coding tips, and general tutorials.
21 posts Page 1 of 2 First unread post
CraftDinur
Deuced Up
Posts: 152
Joined: Thu Nov 08, 2012 8:20 pm


Is it possible to adjust your clip and reserve ammo on spawn and maintain that throughout the game? For example, could I change the shotgun to have 10 ammo in clip and 50 in reserve like a rifle and stay that way through the whole game? I've been attempting to make a script that will do this but it seems to be failing and whenever I go in game nothing happens.
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


It would be nice for the guns to have more ammo and not just the rifle and shot gun
LinktersHD
Deuced Up
Posts: 124
Joined: Thu Nov 01, 2012 12:27 pm


CraftDinur wrote:
Is it possible to adjust your clip and reserve ammo on spawn and maintain that throughout the game? For example, could I change the shotgun to have 10 ammo in clip and 50 in reserve like a rifle and stay that way through the whole game? I've been attempting to make a script that will do this but it seems to be failing and whenever I go in game nothing happens.
Nope, it's client side with the amount of ammo, though it might be possible.
topo
Global Moderator
Global Moderator
Posts: 179
Joined: Thu Nov 01, 2012 12:43 pm


Danko pasted this in #aloha a while ago (possibly originally showing it to you?) but in case anyone else wants it, http://paste.quacknet.org/view/e53282c7 ... 81c95da.py
Handles
League Participant
League Participant
Posts: 1087
Joined: Tue Jan 08, 2013 9:46 pm


Im not sure it's possible... Green_Septic
LinktersHD
Deuced Up
Posts: 124
Joined: Thu Nov 01, 2012 12:27 pm


topo wrote:
Danko pasted this in #aloha a while ago (possibly originally showing it to you?) but in case anyone else wants it, http://paste.quacknet.org/view/e53282c7 ... 81c95da.py
Have you tried it out?
CraftDinur
Deuced Up
Posts: 152
Joined: Thu Nov 08, 2012 8:20 pm


topo wrote:
Danko pasted this in #aloha a while ago (possibly originally showing it to you?) but in case anyone else wants it, http://paste.quacknet.org/view/e53282c7 ... 81c95da.py
i didn't see this. thanks for posting it here. i'll try this out when i have some spare time.
LinktersHD
Deuced Up
Posts: 124
Joined: Thu Nov 01, 2012 12:27 pm


CraftDinur wrote:
topo wrote:
Danko pasted this in #aloha a while ago (possibly originally showing it to you?) but in case anyone else wants it, http://paste.quacknet.org/view/e53282c7 ... 81c95da.py
i didn't see this. thanks for posting it here. i'll try this out when i have some spare time.
Did you try it?
topo
Global Moderator
Global Moderator
Posts: 179
Joined: Thu Nov 01, 2012 12:43 pm


Why don't you try it?
LinktersHD
Deuced Up
Posts: 124
Joined: Thu Nov 01, 2012 12:27 pm


topo wrote:
Why don't you try it?
Haven't got time, but i do now, going to try it out now.
Code: Select all
from pyspades.server import weapon_reload
 
 
# Run this on players at spawn to set their ammo/stock to whatever
# Not sure how well this works *in general*, because I've only tested with ridiculous values
# and that's caused some reloading bugs
def bleep_bloop(player, new_ammo, new_stock):
    weapon = player.weapon_object
    weapon.set_shoot(False)
    weapon.current_ammo = new_ammo
    weapon.current_stock = new_stock
    weapon_reload.player_id = player.player_id
    weapon_reload.clip_ammo = weapon.current_ammo
    weapon_reload.reserve_ammo = weapon.current_stock
    player.send_contained(weapon_reload)
Do i replace "new_ammo with the amount of ammo and etc?
LinktersHD
Deuced Up
Posts: 124
Joined: Thu Nov 01, 2012 12:27 pm


Simple answer....NO it does not work:
Image
topo
Global Moderator
Global Moderator
Posts: 179
Joined: Thu Nov 01, 2012 12:43 pm


you are legitimately awful
cow
Deuced Up
Posts: 56
Joined: Mon Nov 05, 2012 7:40 pm


Excuse the shameless advertising, but it's already been done on Stormwind's servers :)
EldredChandler
Build and Shoot's 1st Birthday
Build and Shoot's 1st Birthday
Posts: 730
Joined: Mon Nov 05, 2012 5:09 pm


omg this entire thing
LinktersHD
Deuced Up
Posts: 124
Joined: Thu Nov 01, 2012 12:27 pm


cow wrote:
Excuse the shameless advertising, but it's already been done on Stormwind's servers :)
How did you do it?
21 posts Page 1 of 2 First unread post
Return to “Help!”

Who is online

Users browsing this forum: No registered users and 17 guests