Raised This Month: $ Target: $400
 0% 

is_matchstart ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 08-15-2012 , 15:38   is_matchstart ?
Reply With Quote #1

how would I check when a clanmatch has started?
For our game half-life deathmatch: adrenaline gamer a clanmatch has started when the global event 'Countdown' has passed.
so this should be fairly easy but I cant get it working.

PHP Code:
#include <amxmodx> 
#include <fakemeta> 


new g_Matchstart[33];

public 
plugin_init() 

    
register_plugin("clanmatchstart","1.2","test")  
    
register_event"Countdown""StartMatch""a""1=9"
    
register_clcmd("say /matchstart""hasmatchstarted");

public 
StartMatch(id
{   
  
g_Matchstart[id] = true
}
bool:is_matchstart(id)
  return 
g_Matchstart[id];

public 
hasmatchstarted(id
{
    
client_print(idprint_chat"* clan match has %s started."is_matchstart(id) ? "" " not");
    return 
PLUGIN_HANDLED;

I know within global events u cant use (id) so this was a failed attempt.
with my next attempt I am thinking off replacing the g_Matchstart with a new server cvar.
but this must be possible to achieve on a more efficient way, not?
vamppa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-15-2012 , 15:42   Re: is_matchstart ?
Reply With Quote #2

I don't see a reason for the variable to be per-player.

PHP Code:
#include <amxmodx> 

new bool:g_Matchstart;

public 
plugin_init() 

    
register_plugin("clanmatchstart","1.2","test")  
    
register_event"Countdown""StartMatch""a""1=9"
    
register_clcmd("say /matchstart""hasmatchstarted");

public 
StartMatch() 
{   
  
g_Matchstart true
}

public 
hasmatchstarted(id
{
    
client_print(idprint_chat"* clan match has %s started."g_Matchstart "" " not");
    return 
PLUGIN_HANDLED;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 08-15-2012 at 15:42.
Exolent[jNr] is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 08-15-2012 , 16:06   Re: is_matchstart ?
Reply With Quote #3

thanks Ill give that a shot, using bool does not require fakemeta?
vamppa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-15-2012 , 16:08   Re: is_matchstart ?
Reply With Quote #4

No, bool is a generic Pawn tag. No include is required to use it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 08-15-2012 , 17:26   Re: is_matchstart ?
Reply With Quote #5

nice learned something again.
btw it works! there is a reason I would like to use this for (id) I didn't state.
I thought this would be impossible because of the global event but I only need the global event to determan wether or not a clanmatch has started.
is there a way to do something on per player (id) when the clanmatch has started?

for example:

this
PHP Code:
gDeaths[id] = 
check_netgraph
(id); 
which comes from
PHP Code:
#define SCREENSHOT_PER_DEATHS 5 

public check_netgraph(id
{
   
query_client_cvarid "net_graph" "get_netgraph" );
   return 
PLUGIN_CONTINUE;
}
public 
get_netgraphid , const cvar[], const snetValue[])
{
  
client_cmd(id"net_graph 3"); 
  
client_cmd(id"status;wait;wait;wait;wait;wait;snapshot"
  
client_cmd(id"net_graph %s" snetValue );
}
public 
Event_DeathMsg() 

    new 
id read_data(2
    if ( ! (++
gDeaths[id] % SCREENSHOT_PER_DEATHS) ) 
    { 
        
check_netgraph(id);
    } 

vamppa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-15-2012 , 17:29   Re: is_matchstart ?
Reply With Quote #6

In the global event, just loop through all players.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 08-17-2012 , 14:09   Re: is_matchstart ?
Reply With Quote #7

PHP Code:
public globalevent () 
{
   new 
players[32], numplayersid;
   
get_players playersnumplayers );
   for ( new 
i=0i<numplayersi++ ) {
   
id=players[i];
   
//code ........
  
}

ok thanks!!!
this is a break through and makes a lot possible for the things I wanted to do.

Last edited by vamppa; 08-17-2012 at 18:08.
vamppa is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 10-23-2012 , 15:09   Re: is_matchstart ?
Reply With Quote #8

ok theres a problem looping through the players mixes up info retrieved from each player.
player index number gets moved or something.

Example: http://rghost.net/41114478.view
the steamid in the HUD is not correct one nor is the Ip.
would there be a way to solve this?
vamppa is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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