Author Topic: Trigger Zitro?  (Read 1667 times)

0 Members and 1 Guest are viewing this topic.

Offline jeffslife

  • Major(1)
  • Posts: 5
Trigger Zitro?
« on: February 09, 2007, 07:47:32 pm »
Howdy scripters!

I've just started jumping into all this scripting fun, and my first attempt at something useful was an event to trigger the update.php for ZitroStats.

I was looking at the events list and the only one I really saw on there was OnMapLoad (or something like that) which I was hoping to send a URL request to update.php when that event happened...  Which I would hope would cause it to run and update the DB.  (Ideally updating the stats at the end of each round).

Also I was thinking if the Deathmatch score was set to 30 and the timelimit was set to 30 (or whatever) I also might be able to check for either of those to trigger the update.php request.

Is this possible?  Does there exist a command that would properly cause the update.php script to fire?

Thanks in advance. :)

Offline Frenchie

  • Camper
  • ***
  • Posts: 358
  • SoldatHQ
Re: Trigger Zitro?
« Reply #1 on: February 09, 2007, 08:40:04 pm »
This thread has a script to get in-game stats from zitro.

But I'm guessing you could probably use
Code: [Select]
GetURL(www.site.com/update.php);
Soldat Lobby Avec Players -New Release! - Updated AGAIN!


Offline jeffslife

  • Major(1)
  • Posts: 5
Re: Trigger Zitro?
« Reply #2 on: February 09, 2007, 09:22:48 pm »
Right, that's what I was thinking, I wasn't sure if that was the way to do it...

Yah I have the in-game !stats script working, and it only updates when the database is updated via update.php,

so I wanted to happen at the end of each round, but the only command I saw in there that might help me out is OnMapLoad (which actually happens everytime a level is finished loading, and not at the end of a round).

Then I was thinking maybe I could call the GetURL if a score limite or time limit was hit instead of OnMapLoad.

And also I'm sure there's a way better way to do this, but I'll leave that one to you experts. :)

Any advice?

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Trigger Zitro?
« Reply #3 on: February 09, 2007, 11:17:11 pm »
Er, using OnMapLoad and when a score limit is hit will do the exact same thing, only difference is that if you did it via score, it would happen right when the game ends and the score menu pops up, OnMapLoad gets called like 2 seconds later, once the new map has loaded....

And use GetURL('http://mysite.com/update.php');

Note that this will cause your server to hang untill the update finishes, or you can wait for 2.6.0 where you will be able to use ThreadFunc.

Offline jeffslife

  • Major(1)
  • Posts: 5
Re: Trigger Zitro?
« Reply #4 on: February 10, 2007, 11:49:40 am »
Er, using OnMapLoad and when a score limit is hit will do the exact same thing, only difference is that if you did it via score, it would happen right when the game ends and the score menu pops up, OnMapLoad gets called like 2 seconds later, once the new map has loaded....

And use GetURL('http://mysite.com/update.php');

Note that this will cause your server to hang untill the update finishes, or you can wait for 2.6.0 where you will be able to use ThreadFunc.

Yah I know they would do the same thing but I guess I had the idea in my head that processing the script at the end of a round (when the score chart pops up) would be better than calling the script in the beginning of a round when players would actually be doing something.. :P

Why will it cause the server to hang?

Thanks for replies so far!