View Single Post
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 03-26-2011 , 05:28   Re: [TF2]How to show notification of player who pickup/drop intelligence?
Reply With Quote #4

so sad. but atm I just cant explain. too hard to do this from mobile phone

just look
events have a params, right?
one of them - flag event type, type of event
dropped, captured, carried, returned, defended.
eventtype is a numeric value
and I cant remember values of each of them

EDIT:
PHP Code:
public Action:Event_FlagStatus(Handle:hEvent, const String:sName[], bool:bDontBroadcast)
{
    new 
String:sClientAuth[32], String:sQuery[256];
    switch(
GetEventInt(hEvent"eventtype"))
    {
        case 
1// pick up
        
{
            new 
iClient GetEventInt(hEvent"player");
            
PrintToChatAll("%N has picked up a flag"iClient);
        }
        case 
2// captured
        
{
            new 
iClient GetEventInt(hEvent"player");
            
PrintToChatAll("%N has captured a flag"iClient);
        }
        case 
3// defended
        
{
            new 
iAttacker GetEventInt(hEvent"player");
            new 
iVictim GetEventInt(hEvent"carrier");
            
PrintToChatAll("%N has defended a flag (carried by %N)"iAttackeriVictim);
        }
        case 
4// dropped
        
{
            new 
iClient GetEventInt(hEvent"player");
            
PrintToChatAll("%N has dropped a flag"iClient);
        }
        case 
5// returned
        
{
            
PrintToChatAll("A flag has been return to base"iClient);
        }
    }
    return 
Plugin_Continue;


Last edited by Leonardo; 03-26-2011 at 07:24.
Leonardo is offline