AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Logevent issue (https://forums.alliedmods.net/showthread.php?t=225069)

rodrigo286 08-31-2013 12:50

Logevent issue
 
I need that value[client] is reset every time if round ends, however this does not happen, I'm doing something wrong?

PHP Code:

public plugin_init() 
{
    
register_logevent("logevent_round_end"2"1=Round_End"); // Round end event
}

public 
logevent_round_end(client)
{
    
value[client] = 0;
}

public 
respawnCMD(client)
{
    
value[client] += 1;


Thanks for help. :bacon!:

ConnorMcLeod 08-31-2013 12:58

Re: Logevent issue
 
logevents never pass a player index.

do this :

PHP Code:

    arrayset(value0sizeof(value)) 


rodrigo286 08-31-2013 13:16

Re: Logevent issue
 
Quote:

Originally Posted by ConnorMcLeod (Post 2025563)
logevents never pass a player index.

do this :

PHP Code:

    arrayset(value0sizeof(value)) 


Thanks, it works perfectly !!!

But, is there any way when player index if new round begins?

Thanks.

Kia 08-31-2013 13:20

Re: Logevent issue
 
Use get_players.

ConnorMcLeod 08-31-2013 13:55

Re: Logevent issue
 
No way, but if you prefer new round over round end, use following event :

PHP Code:

    register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
}

public 
Event_HLTV_New_Round()
{
    
arrayset(value0sizeof(value))



Kia 08-31-2013 14:08

Re: Logevent issue
 
How does arrayset get the players index? o0

// EDIT : I see now that you want to set it for all players, my bad.

akcaliberg 08-31-2013 14:25

Re: Logevent issue
 
by the way, is there a list that contains all logevents ?

Kia 08-31-2013 14:30

Re: Logevent issue
 
https://www.google.de/url?sa=t&sourc...51495398,d.ZG4

akcaliberg 08-31-2013 14:32

Re: Logevent issue
 
Quote:

Originally Posted by akcaliberg (Post 2025634)
by the way, is there a list that contains all logevents ?

nevermind, i think it's not needed at all

rodrigo286 08-31-2013 14:41

Re: Logevent issue
 
Thanks.

This loop also work:

PHP Code:

public plugin_init() 
{
    
register_event("HLTV""LogEvent_RoundStart""a""1=0""2=0"); 
}

public 
LogEvent_RoundStart()
{
    new 
players[32], pnum;
    
get_players(playerspnum);
    for(new 
0pnumi++)
    {
        
value[i] = 0;
    }


Regards. :)


All times are GMT -4. The time now is 18:49.

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