gungame utils question

Ask questions and share info about GunGame 5

gungame utils question

Postby WebJunkie » Thu Dec 04, 2008 4:55 pm

currently i run a gungame5 server with the addons mani-1.2s+evenscripts-beta250+gungame utils. and the deathmatch seems to be stable. i would like to add a unlimited ammo addon but it uses es_tools. i would prefer not to use es_tools because of all the crashing issues i had using it. My question is, is there any tools built into the gungame utils that would allow a unlimited ammo script to be run?
WebJunkie

Private
Private
 
Posts: 19
Joined: Thu Dec 04, 2008 4:17 am
Steam Friends Name: WebJunkie

Postby PitBull » Thu Dec 04, 2008 5:06 pm

I don't know if these scripts work, but they should.

1. You have unlimited reserve ammo, but you have to reload
import es
import playerlib

def weapon_reload(event_var):
    playerlib.getPlayer(event_var['userid']).set("ammo", [event_var['es_userweapon'],999])

2. You do not have to reload
import es
import playerlib

def weapon_fire(event_var):
    playerlib.getPlayer(event_var['userid']).set("ammo", [event_var['weapon'],999])
PitBull

GunGame5 Developer
GunGame5 Developer
User avatar
 
Posts: 66
Joined: Mon Nov 10, 2008 7:05 pm
Steam Friends Name: wergup_pitbull

Postby Don » Thu Dec 04, 2008 5:47 pm

The second version would be my choice but you could change the 999 to a much lower number. You could actually set it to 2 for everything except the burst mode gun(Bullpup?). I would think setting that to something like 30 would work for everything.
Don

Site Admin
Site Admin
User avatar
 
Posts: 529
Joined: Fri Sep 05, 2008 3:05 am
Location: The Valley
Steam Friends Name: Don
Xfire Name: donlafferty

Postby Warren » Thu Dec 04, 2008 6:27 pm

The Famas and Glock have burst modes.
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Re:

Postby PitBull » Thu Dec 04, 2008 8:16 pm

So just use this:
import es
import playerlib

def weapon_fire(event_var):
    playerlib.getPlayer(event_var['userid']).set("ammo", [event_var['weapon'],10])
Saul: If I see a server where I have to download music, I quit instantly, set cl_download_filer all then find another server.
crazypip666: Wait, so you don't actually play GunGame?
Don: Owned!
PitBull

GunGame5 Developer
GunGame5 Developer
User avatar
 
Posts: 66
Joined: Mon Nov 10, 2008 7:05 pm
Steam Friends Name: wergup_pitbull

Re: gungame utils question

Postby WebJunkie » Thu Dec 04, 2008 8:32 pm

thanks for the speedy relpy's, but what i neglected to inform you of was my enourmous lack of knowledge. I would guess what i do with this is create a text file. put it in a folder in eventscrpts and then run it as an evenscript. would that be a good or bad assumption? thanks(try not to bash the noob too bad please)
WebJunkie

Private
Private
 
Posts: 19
Joined: Thu Dec 04, 2008 4:17 am
Steam Friends Name: WebJunkie

Re: gungame utils question

Postby WebJunkie » Thu Dec 04, 2008 9:26 pm

nevermind, i think i figured it out. create a .py file using notepad. create and place in a folder in custom_addons. am i gettin warm?
WebJunkie

Private
Private
 
Posts: 19
Joined: Thu Dec 04, 2008 4:17 am
Steam Friends Name: WebJunkie

Re: gungame utils question

Postby Don » Thu Dec 04, 2008 9:32 pm

WebJunkie wrote:nevermind, i think i figured it out. create a .py file using notepad. create and place in a folder in custom_addons. am i gettin warm?

Warmer but the simplest way would be to create a file called something like unlimited_ammo.py. Put that into a folder under cstrike/addons/eventscripts/unlimited_ammo and then put this in your autoexec.cfg.:
es_load unlimited_ammo
That would be the easiest way to use it without having to worry about it being a custom addon.
I am 31% addicted to Counterstrike. What about you?
Don

Site Admin
Site Admin
User avatar
 
Posts: 529
Joined: Fri Sep 05, 2008 3:05 am
Location: The Valley
Steam Friends Name: Don
Xfire Name: donlafferty

Re: gungame utils question

Postby WebJunkie » Thu Dec 04, 2008 10:40 pm

thank you all for the help, i'll try it out and respond on how it went. thanks again
WebJunkie

Private
Private
 
Posts: 19
Joined: Thu Dec 04, 2008 4:17 am
Steam Friends Name: WebJunkie

Re: gungame utils question

Postby WebJunkie » Thu Dec 04, 2008 11:18 pm

Ok this is what i have, how can i add a message to the server at start up?

# ==============================================================================
#   IMPORTS
# ==============================================================================

# EventScripts imports
import es
import playerlib

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name     = 'unlimited ammo'
info.version  = '1.0.0'
info.url      = 'http://forums.gungame5.com/viewtopic.php?f=12&t=330'
info.basename = 'addons/eventscripts/unlimited_ammo'
info.author   = 'Gungame5 Forum'

# ==============================================================================
#   GAME EVENTS
# ==============================================================================

def weapon_fire(event_var):
    playerlib.getPlayer(event_var['userid']).set("ammo", [event_var['weapon'],10])
WebJunkie

Private
Private
 
Posts: 19
Joined: Thu Dec 04, 2008 4:17 am
Steam Friends Name: WebJunkie

Postby WebJunkie » Fri Dec 05, 2008 2:26 am

this code works but, you still have to reload. i'm looking for unlimited ammo with no reload. i was using one called omg_ammo but it used es tools. i was hoping that gungame utils used a similar command as es_tools so that i could just edit the code, but thats probably not possible. here was the code from omg_ammo:
block load
{
  es_doblock corelib/noisy_on
  es_xset pweapon 0
}

block unload
{
  es_doblock corelib/noisy_off
}

event round_start
{
   es_msg #multi #green Enjoy unlimited ammo!
}

event weapon_fire
{
  es_xset pfire 0
  es_xset pweapon 0

    es_format pweapon "weapon_%1" event_var(weapon)
    es est_getweaponindex pfire event_var(es_username) server_var(pweapon)
   
    es es_setindexprop server_var(pfire) "CBaseCombatWeapon.LocalWeaponData.m_iClip1" 124
}
 


thanks for your help guys. this thread probably needs to continue in the suggestions forum instead of in here, so i apologize.
WebJunkie

Private
Private
 
Posts: 19
Joined: Thu Dec 04, 2008 4:17 am
Steam Friends Name: WebJunkie

Postby Warren » Fri Dec 05, 2008 3:07 am

Since unlimited ammo is not a new idea, and it doesn't really relate to gungame, check out this filter on ESAM. I'm sure it would be easiest to just use one of those.

http://addons.eventscripts.com/addons/tags/527
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Postby Don » Fri Dec 05, 2008 3:35 am

Oh yeah, that script up top needs eventscripts_noisy 1. I forgot to mention that.
Don

Site Admin
Site Admin
User avatar
 
Posts: 529
Joined: Fri Sep 05, 2008 3:05 am
Location: The Valley
Steam Friends Name: Don
Xfire Name: donlafferty

Postby PitBull » Fri Dec 05, 2008 1:04 pm

Also there is a mistake with the set-part. I set the ammo, but I need to set the clip:
def weapon_fire(event_var):
    playerlib.getPlayer(event_var['userid']).set("clip", [event_var['weapon'],10])
PitBull

GunGame5 Developer
GunGame5 Developer
User avatar
 
Posts: 66
Joined: Mon Nov 10, 2008 7:05 pm
Steam Friends Name: wergup_pitbull



Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron