Raised This Month: $ Target: $400
 0% 

[SNIPPET] Event "trick"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-28-2008 , 04:04   [SNIPPET] Event "trick"
Reply With Quote #1

I found (with the help of WebDestroya) that it's possible to block events like player_team which will stop the "X joined team X" in chat, and then re-fire this event for other plugins to use:

Code:
new bool:ptFire = true;
public Action:PlayerTeam_Pre(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (ptFire)
    {
        new Handle:hPlayerTeam = CreateEvent("player_team", true);
        
        SetEventInt(hPlayerTeam, "userid", GetEventInt(event, "userid"));
        SetEventInt(hPlayerTeam, "team", GetEventInt(event, "team"));
        SetEventInt(hPlayerTeam, "oldteam", GetEventInt(event, "oldteam"));
        SetEventBool(hPlayerTeam, "disconnect", GetEventBool(event, "disconnect"));
        
        ptFire = false;
        FireEvent(hPlayerTeam, true);
        ptFire = true;
        
        return Plugin_Handled;
    }
    
    return Plugin_Continue;
}
Have fun
__________________
Greyscale is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-28-2008 , 13:59   Re: [SNIPPET] Event "trick"
Reply With Quote #2

Wouldn't that still show the text anyways because you're just resending the event?
bl4nk is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-31-2008 , 17:14   Re: [SNIPPET] Event "trick"
Reply With Quote #3

Quote:
Originally Posted by bl4nk View Post
Wouldn't that still show the text anyways because you're just resending the event?
No because I'm resending it with dontBroadcast set to true
__________________
Greyscale is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-31-2008 , 17:17   Re: [SNIPPET] Event "trick"
Reply With Quote #4

Ah, I missed that part. Very well done.
bl4nk is offline
Reply


Thread Tools
Display Modes

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 21:45.


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