Spawn Protection

Ask questions and share info about GunGame 5

Spawn Protection

Postby tnarocks » Sun Aug 08, 2010 1:36 am

I got a error in the error logs for spawn protection and this is what it says.


*******************************************************************************
* *
* GUNGAME v5.1 ERROR LOGGING *
* HTTP://WWW.GUNGAME5.COM/ *
* *
* GG VERSION: 5.1.481 IP: 63.211.221.204 *
* SPE VERSION: 1.5.0f r78 PORT: 27015 *
* PLATFORM: POSIX DATE: 08-04-2010 *
* ES VERSION: 2.1.1.338 ES CORE VERSION: 2.1.1.336 *
* MM VERSION: 1.8.3V SM VERSION: 0 *
* MANI VERSION: 1.2V VSP EST VERSION: 0 *
* *
*******************************************************************************


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
LAST EVENT: [08/04/2010 @ 17:25:45] TOTAL OCCURENCES: [0001]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Traceback (most recent call last):
File "../eventscripts/es.py", line 269, in triggerEvent
self.EventListeners[eventname][listener](event_var)
File "../eventscripts/gungame51/core/addons/__init__.py", line 430, in call_event
current_event[name](event_var)
File "../eventscripts/gungame51/scripts/included/gg_spawn_protect/gg_spawn_protect.py", line 112, in player_spawn
if getPlayer(userid).isdead or int(event_var['es_userteam']) < 2:
File "../eventscripts/_libs/python/playerlib.py", line 1294, in getPlayer
raise e

UseridError: '5' is an invalid userid
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Sun Aug 08, 2010 2:33 am

I would imagine that swapping those 2 conditionals would fix this error:
   # Is player alive?
    if int(event_var['es_userteam']) < 2 or getPlayer(userid).isdead:
        return

Alternatively, we could always use the Event Variable es_userdead in place of playerlib's isdead:
   # Is player alive?
    if int(event_var['es_userdead']) or int(event_var['es_userteam']) < 2:
        return

Have you had any issues with Spawn Protection not working?

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Sun Aug 08, 2010 2:20 pm

No it works. Thats just the error that i get when i checked the logs yesterday.
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby tnarocks » Sun Aug 08, 2010 2:22 pm

this is what my spawn protection cfg looks like.

// ****************************************************************************
// * gg_spawn_protect.cfg -- Spawn Protect Configuration *
// * *
// * This file defines GunGame Addon settings. *
// * *
// * Note: Any alteration of this file requires a *
// * server restart or a reload of GunGame. *
// ****************************************************************************



// ============================================================================
// >> SPAWN PROTECTION
// ============================================================================
// Description:
// The number of seconds to allow spawn protection, in which they will be
// immune to other players fire but cannot levelup if they kill a player.
// Options:
// 0 = (Disabled) Do not load gg_spawn_protect.
// # = Time (in seconds) for players to be spawn protected.
// Default Value: 0

// Enables/Disables spawn protection.
gg_spawn_protect 3


// ============================================================================
// >> SPAWN PROTECTION COLORS
// ============================================================================
// Description:
// The player's color while under spawn protection.
// Notes:
// * Colors are set via the RGB (red/green/blue) model. For more information
// on how to get the color you want, visit:
// http://www.tayloredmktg.com/rgb/
// * Alpha is the transparency of the player. The lower the number, the more
// transparent the player becomes.
// Options:
// 0-255
// Default Values:
// * Red: 255
// * Green: 255
// * Blue: 255
// * Alpha: 150

// The red shade of the spawn protected player.
gg_spawn_protect_red 255

// The green shade of the spawn protected player.
gg_spawn_protect_green 255

// The blue shade of the spawn protected player.
gg_spawn_protect_blue 255

// The alpha of the spawn protected player.
gg_spawn_protect_alpha 150


// ============================================================================
// >> SPAWN PROTECTION "CANCEL-ON-FIRE"
// ============================================================================
// Description:
// Cancels the spawn protection timer when the player fires their weapon and
// allows the player to level up.
// Note:
// * Uses "eventscripts_noisy", which "may" cause lag.
// Options:
// 0 = (Disabled) Do not load gg_spawn_protect_cancelonfire.
// 1 = (Enabled) Load gg_spawn_protect_cancelonfire.
// Default Value: 0

// Cancels spawn protection when the weapon is fired.
gg_spawn_protect_cancelonfire 0


// ============================================================================
// >> ALLOW LEVELING WHILST PROTECTED
// ============================================================================
// Description:
// Players can level up while spawn protected.
// Options:
// 0 = (Disabled) Do not allow players to level up while spawn protected.
// 1 = (Enabled) Allow players to level up while spawn protected.
// Default Value: 0

// Allow players to level up while spawn protected
gg_spawn_protect_can_level_up 1
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Sun Aug 08, 2010 3:43 pm

Ok, I just wanted to make sure. Either of those fixes 'should' prevent the error from occurring. Thanks for reporting it.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Sun Aug 08, 2010 5:49 pm

Your welcome. Did you want me to change what you said and see if i get any errors .
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby satoon101 » Sun Aug 08, 2010 5:57 pm

You can if you'd like to. Hopefully one of those fixes will make it into the next release. I'd probably prefer the second method, as there is no need to call playerlib.getPlayer() if we don't have to.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby tnarocks » Sun Aug 08, 2010 8:59 pm

i think that i will wait im not very good at editing things like that and dont want to mess it up and screw something up.
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)



Return to General Discussion

Who is online

Users browsing this forum: No registered users and 44 guests