AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   round checker (https://forums.alliedmods.net/showthread.php?t=128856)

Amonel 06-06-2010 08:16

round checker
 
a simple script to check round # and print at it's round start...

example:

if round #2 print at round start: This is round nomber 2!

if round #13 print at round end: This was a lucky round...

reinert 06-06-2010 09:43

Re: round checker
 
new round = 1;

register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

public event_new_round(){
round++;
if(round == 1){
client_print(id, print_chat, "This is round number 1!)}else if(round == 2){
client_print(id, print_chat, "This is round number 2!)}else if(round == 3){
client_print(id, print_chat, "This is round number 3!)}
}

drekes 06-06-2010 10:23

Re: round checker
 
PHP Code:

#include <amxmodx>

new roundnr 1;

public 
plugin_init()
         
register_logevent("Event_RoundStart"2"1=Round_Start")

public 
Event_Roundstart()
{
    
client_print(0print_chat"This is round number %i"roundnr)
    
roundnr++;


@reinert:
You can display the round number in client_print so if and else if in not neccesary, and you don't have id in HLTV.

reinert 06-06-2010 10:36

Re: round checker
 
roundnr++; should be before client_print I think :p BTW: he asked how to make different messages.

drekes 06-06-2010 11:35

Re: round checker
 
if roundnr++ is before client_print, you should start from 0, because else if it starts as 1 it will first make roundnr 2 and then print it's to

Use cases to make different messages.

reinert 06-06-2010 11:48

Re: round checker
 
oh right.


All times are GMT -4. The time now is 05:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.