Server Help

ASSS Questions - Final question.

BDwinsAlt - Sun Jul 16, 2006 12:20 pm
Post subject: Final question.
Here is my final question. How can I find out if anyone won the flag game in python. I tried doing a CB for flags and it didnt work. What I'm doing is giving players money once they win the flag game. Everything is setup but I don't know how to make it check if anyone won.

Plx help, thx.
Smong - Sun Jul 16, 2006 12:42 pm
Post subject:
You could use CB_FLAGRESET (flagcore.h), but CB_WARZONEWIN (fg_wz.h) is meant for calculating the points, so maybe do it in that one instead.
BDwinsAlt - Sun Jul 16, 2006 6:39 pm
Post subject:
Neither one of those seem to work. fg_wz is loaded.
Can you show a bit of code.

what I have:
Code: Show/Hide

def flags(freq, points):
    .....
cb4 = reg_callback(CB_WARZONEWIN, flags)

Smong - Sun Jul 16, 2006 8:30 pm
Post subject:
I am pretty sure there is supposed to be an arena parameter. Next time read the .h files more carefully.
Quote:
#define CB_FLAGRESET "flagreset"
typedef void (*FlagResetFunc)(Arena *a, int freq, int points);
/* pycb: arena, int, int */
/* run when the flag game is reset (either a win or a forced reset) */

Code: Show/Hide

def flagreset(arena, freq, points):
    ...

cb1 = reg_callback(CB_WARZONEWIN, flagreset)

BDwinsAlt - Sun Jul 16, 2006 8:40 pm
Post subject:
Ty Ty
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group