Code: Show/Hide /* player data */
typedef struct SpreeData { int kills; } SpreeData; local int playerKey; |
Code: Show/Hide SpreeData *killerSpree = PPDATA(killer, playerKey);
SpreeData *killedSpree = PPDATA(killed, playerKey); killerSpree->kills++; killedSpree->kills = 0; |
Code: Show/Hide 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 |