 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat May 05, 2007 9:42 pm Post subject: >goal< spree module |
 |
|
|
|
Would anyone be willing to introduce me to a goal spree module. It'd be just like a spree module, there fore doing this:
1.recgoinzing a goal, and who scored it.
2.addinga goal to spree "tracker" data
3.arena messages anouncing spree achievements(for example 10 goals);
4.include bongs in arena messages
some great others would be
1.assists(player that touched the ball b4 player that scored scores)
ty very much.
|
|
Back to top |
|
 |
Animate Dreams Gotta buy them all! (Consumer whore)

Age:37 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Sat May 05, 2007 11:33 pm Post subject: |
 |
|
|
|
I modified my points_kill module to work based off of spreeing, it's fairly easy. First, you'll need playerdata, which should go something like this:
/* player data */
typedef struct SpreeData
{
int kills;
} SpreeData;
local int playerKey; |
Then I just added this code to the beginning of the function:
SpreeData *killerSpree = PPDATA(killer, playerKey);
SpreeData *killedSpree = PPDATA(killed, playerKey);
killerSpree->kills++;
killedSpree->kills = 0; |
And then at the end, points are updated with the line *totalpts += pts; , so right before that line I decided I'd reward points based on a multiplier equal to their number of kills: pts = pts * killerSpree->kills; , so I put that line of code right before the *totalpts += pts; . Er, um... you should also, in the MM_ATTACH section, allocate your data( playerKey = pd->AllocatePlayerData(sizeof(SpreeData)); ), and then free that data(just like in the C tutorial for modules, but I just realized I never did that, yet my module works... wtf.
|
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sat May 05, 2007 11:38 pm Post subject: |
 |
|
|
|
EDIT: ACK nvm you replied b4 me.
Untest but you can try this. (ATTACHED and TYPED)
from asss import *
chat = get_interface(I_CHAT)
def mm_attach(arena):
arena.cb1 = reg_callback(CB_GOAL, goalspree, arena)
arena.cb2 = reg_callback(CB_PLAYERACTION, paction, arena)
def mm_detach(arena):
arena.cb1 = None
arena.cb2 = None
def goalspree(arena, p, bid, x, y):
p.goalspree_spree += 1
if p.goalspree_spree == 10:
chat.SendArenaSoundMessage(arena, SOUND_GOAL, "%s Blah Blah Blah! (10:0)" % (p.name) )
elif p.goalspree_spree == 15:
chat.SendArenaSoundMessage(arena, SOUND_GIRL, "%s No me gusta a Bill Gates! (15:0)" % (p.name) )
def paction(p, action, arena):
if action == PA_ENTERGAME:
p.goalspree_spree = 0
elif action == PA_LEAVEARENA:
p.goalspree_spree = None
|
goalspree.py - 0.73 KB
File downloaded or viewed 44 time(s)
|
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Thu May 17, 2007 2:35 pm Post subject: |
 |
|
|
|
Just wondering when does the spree get reset? When the player dies? _________________ ss news
|
|
Back to top |
|
 |
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu May 17, 2007 3:17 pm Post subject: |
 |
|
|
|
although i don't need it anymore, i would reset every game? if not that then login/out for sure
|
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 49 page(s) served in previous 5 minutes.
|