AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   count game rounds (https://forums.alliedmods.net/showthread.php?t=9334)

madprofessor 01-14-2005 20:46

count game rounds
 
how can I read how many wins each team has?
for example i need to know when the 16th round starts but it is a clan war server and restarts might happen so I can't just count round ends to find the rounds.

can i read the teams wins? the ones that display when you press tab :D

plz help! thanks in advance

madprofessor 01-27-2005 11:01

plz help me?? :oops:

XxKpAznGuyxX 01-27-2005 11:50

press Tab it should say how many round you wonn and for the other team also.

Twilight Suzuka 01-27-2005 12:39

He means how do you read it through into a plugin.

You would have to write and read the relavant data from something, like a file or sql base.

XxAvalanchexX 01-27-2005 15:30

I'm assuming you could catch the TeamScore event and add up how many rounds the Ts have won compared to how many the CTs have won, and store it in a variable.

johnjg75 01-27-2005 19:46

Code:
new rounds public plugin_init() {  register_event("ResetHUD","do","a") } public do() {  num++  //do your checking function here  if(num<>16)   return PLUGIN_HANDLED  if(num==16) {   // do whatcha want  }
I kno u want to read teams but maybe this helps... 8)

XxAvalanchexX 01-27-2005 21:43

a) you define "rounds" but use "num"
b) ResetHUD does not mean "spawn", it is called on multiple occassions, and it happens for everyone, so the variable would be off.

Freecode 01-27-2005 23:21

ur best choice is register a team win event like when they play sound T wins or CT wins and count ur rounds from there.

Da Bishop 01-28-2005 09:26

or use logevent which is slightly better.

Damocles 01-28-2005 10:36

what about this sort of thing...

Code:
register_event("TeamScore", "team_score", "a") // Code.... new ctscore = 0 // Round score for CTs new tscore = 0 // Round score for Ts // Code... public team_score() {      new team[32]     read_data(1,team,32)     if (equal(team,"CT"))         ctscore = read_data(2)     else if (equal(team,"TERRORIST"))         tscore = read_data(2)     return PLUGIN_CONTINUE }


All times are GMT -4. The time now is 19:21.

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