Code: Show/Hide [Spree]
ResetSpreeOnFrequencyChange=0 ;Changing freq resets the spree (default=0) ResetSpreeOnShipChange=0 ;Changing ship resets the spree (default=0) SpreeEndMinimum=4 ;If a player on a spree has this many kills and dies.. ;(default=65535) SpreeEndMessage=has had their spree cut short ;..this message will be displayed.. SpreeEndBong=22 ;..and this bong played. (default=0) ;<name> <SpreeEndMessage> <%SpreeEndBong> Message3=is dominating (3:0) ;On 3 consecutive kills, this message will be displayed Bong3=13 ;This bong will be played with the message (default=0) ;<name> <Message#> <%Bong#> |
Code: Show/Hide local helptext_t spree_help =
"Module: spree\n" "Targets: arena, player\n" "Args: [<#>]\n" "Prints out the target player's current spree and best spree,\n" "if no target, yourself, or all players in the current arena\n" "with the specified spree or higher\n"; |
Code: Show/Hide int strrpl(char *string, const char *source, const char *dest)
{ char buf[256]; int number = 0; while (strstr(string, source)) { strncpy(buf, string, strstr(string, source) - string); buf[strstr(string, source) - string] = '\0'; strcat(buf, dest); strcat(buf, strstr(string, source) + strlen(source)); strcpy(string, buf); number++; } return number; } |
Code: Show/Hide [Spree]
ResetKillingSpreeOnFreqChange=1 ResetKillingSpreeOnShipChange=1 KillingSpreeMessage2=%killer is on a killing spree(%kills:%deaths)!%104 KillingSpreeMessage4=%killer is unstoppable(%kills:%deaths)!%2 KillingSpreeMessage6=%killer laughed at %killed's efforts!(%kills:%deaths)%13 |
Code: Show/Hide char sound;
int i; for (i = 255; i >= 0; i--) { strcpy(buf, "%"); itoa(i, buf3, 10); strcat(buf, buf3); if (strrpl(buf2, buf, "")) sound = i; } |
-Smong- wrote: |
Nice work.
I don't see a need for %kills and %deaths if after 1 death the spree is ended (maybe you have some minimum deaths option, I don't know). I had some trouble coding my replace string function, I hope yours is tested thoroughly. This prototype is confusing: int strrpl(char *string, const char *source, const char *dest) ; Looks like you put the text from the conf in 'source', an empty char buffer in 'dest' (even though it is const) and I have no idea what for 'string'. I guess old/new would be good param names, but I'm not sure if new is a reserved keyword. Any chance of uploading a .zip version? Oh and since you said it is a win32 binary, can you compile the latest asss release and give it to explody so he can loot it? |
Code: Show/Hide int strrpl(char *dest, const char *source, const char *target)
{ int number = 0; char buf[512]; if (strstr(target, source)) return -1; while (strstr(dest, source)) { strncpy(buf, dest, strstr(dest, source) - dest); buf[strstr(dest, source) - dest] = '\0'; strcat(buf, dest); strcat(buf, strstr(dest, source) + strlen(source)); strcpy(dest, buf); number++; } return number; } |
Quote: |
Message2=%2%killer is on a spree (2:0) |
Purge+ wrote: |
I guess MGB deleted Quan's bump post... |