Raised This Month: $51 Target: $400
 12% 

SendProxy Manager


Post New Thread Reply   
 
Thread Tools Display Modes
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-09-2012 , 10:45   Re: SendProxy Manager
Reply With Quote #61

Working just fine, thanks again for the quick fix!
I love this extension now
__________________

Last edited by napalm00; 02-09-2012 at 10:46.
napalm00 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 02-09-2012 , 19:31   Re: SendProxy Manager
Reply With Quote #62

Duh.. i didn't print out the element..
That might be the reason i didn't get it to work..
__________________
Peace-Maker is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-12-2012 , 18:03   Re: SendProxy Manager
Reply With Quote #63

How would one go about running a Valid Admin check (using the valid admin check code I've posted below), and if an admin is detected, whenever the admin kills someone, their name is displayed in purple, similar to when someone is killed by the MONOCULUS?

Example:
[img]http://img526.**************/img526/6207/monoculuskill.png[/img]


Valid Admin Check
PHP Code:
// IS VALID ADMIN
stock bool:IsValidAdmin(client)
{
    if (
GetUserFlagBits(client) & ADMFLAG_GENERIC)
    {
        return 
true;
    }
    return 
false;


According to napalm, the purple name thing should be possible:

Quote:
I believe that's managed by the m_iTeamNum of Monoculus, which is probably set to 4 or so.
404UserNotFound is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-13-2012 , 00:52   Re: SendProxy Manager
Reply With Quote #64

PHP Code:
public OnClientPutInServer(client)
{
 if(
IsValidAdmin(client)) //might want to add a check for bots/replay/sourceTV
 
{
  
SendProxy_Hook(client"m_iTeamNum"Prop_IntProxyCallback);
 }
}

public 
Action:ProxyCallback(entity, const String:propname[], &iValueelement

 
//Set iValue to whatever you want to send to clients
 
iValue 4//Play around with the value in here
 
return Plugin_Changed

__________________
napalm00 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-13-2012 , 01:13   Re: SendProxy Manager
Reply With Quote #65

Quote:
Originally Posted by napalm00 View Post
PHP Code:
public OnClientPutInServer(client)
{
 if(
IsValidAdmin(client)) //might want to add a check for bots/replay/sourceTV
 
{
  
SendProxy_Hook(client"m_iTeamNum"Prop_IntProxyCallback);
 }
}

public 
Action:ProxyCallback(entity, const String:propname[], &iValueelement

 
//Set iValue to whatever you want to send to clients
 
iValue 4//Play around with the value in here
 
return Plugin_Changed

Oh wow, how simple! Sweeeet. I've seen a few IsValidClient checks that include bots/SourceTV. I'll have to google around to find them again, but I'll toss them in.

Napalm, you da man.

EDIT Here's what I've got:

PHP Code:
#include <sourcemod>
#include <sendproxy>

#pragma semicolon 1

public Plugin:myinfo =
{
    
name "Purple Name",
    
author "abrandnewday",
    
description "Attempt to turn name purple",
    
version "1.0",
    
url "http://forums.alliedmods.net"
}

public 
OnPluginStart()
{
    
decl String:strModName[32]; GetGameFolderName(strModNamesizeof(strModName));
    if (!
StrEqual(strModName"tf"))
    {
        
SetFailState("This plugin is only for Team Fortress 2.");
    }
}

public 
OnClientPutInServer(client)
{
    if(
IsValidAdmin(client)) //might want to add a check for bots/replay/sourceTV
    
{
        
SendProxy_Hook(client"m_iTeamNum"Prop_IntProxyCallback);
    }
}

public 
Action:ProxyCallback(entity, const String:propname[], &iValueelement)
{
    
//Set iValue to whatever you want to send to clients
    
iValue 6;
    return 
Plugin_Changed;
}  

stock bool:IsValidAdmin(client)
{
    if (
GetUserFlagBits(client) & ADMFLAG_GENERIC)
    {
        return 
true;
    }
    return 
false;

I just tried setting the iValue to 4, 5 and 6, then killed someone. No purple name.

Gonna try out 1, 2 and 3 to see what happens.

I'm probably gonna try all the way up to 10, but if nothing works, I'm not sure what to do.

EDIT 2 Ok so I tried all the way up to 10, from 1. Killed a person each time. No MONOCULUS-style purple name. Don't know what to do now. Hopefully someone with more experience than me can sweep in and make something work.

Last edited by 404UserNotFound; 02-13-2012 at 02:26.
404UserNotFound is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 02-13-2012 , 02:59   Re: SendProxy Manager
Reply With Quote #66

Quote:
Originally Posted by abrandnewday View Post
Oh wow, how simple! Sweeeet. I've seen a few IsValidClient checks that include bots/SourceTV. I'll have to google around to find them again, but I'll toss them in.

Napalm, you da man.

EDIT Here's what I've got:

PHP Code:
#include <sourcemod>
#include <sendproxy>

#pragma semicolon 1

public Plugin:myinfo =
{
    
name "Purple Name",
    
author "abrandnewday",
    
description "Attempt to turn name purple",
    
version "1.0",
    
url "http://forums.alliedmods.net"
}

public 
OnPluginStart()
{
    
decl String:strModName[32]; GetGameFolderName(strModNamesizeof(strModName));
    if (!
StrEqual(strModName"tf"))
    {
        
SetFailState("This plugin is only for Team Fortress 2.");
    }
}

public 
OnClientPutInServer(client)
{
    if(
IsValidAdmin(client)) //might want to add a check for bots/replay/sourceTV
    
{
        
SendProxy_Hook(client"m_iTeamNum"Prop_IntProxyCallback);
    }
}

public 
Action:ProxyCallback(entity, const String:propname[], &iValueelement)
{
    
//Set iValue to whatever you want to send to clients
    
iValue 6;
    return 
Plugin_Changed;
}  

stock bool:IsValidAdmin(client)
{
    if (
GetUserFlagBits(client) & ADMFLAG_GENERIC)
    {
        return 
true;
    }
    return 
false;

I just tried setting the iValue to 4, 5 and 6, then killed someone. No purple name.

Gonna try out 1, 2 and 3 to see what happens.

I'm probably gonna try all the way up to 10, but if nothing works, I'm not sure what to do.

EDIT 2 Ok so I tried all the way up to 10, from 1. Killed a person each time. No MONOCULUS-style purple name. Don't know what to do now. Hopefully someone with more experience than me can sweep in and make something work.
It's very likely that the purple can only be used by the Monoculus. I will check this out further tomorrow, but what you want to manipulate is likely inside the player_death event.
Afronanny is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-13-2012 , 03:04   Re: SendProxy Manager
Reply With Quote #67

Quote:
Originally Posted by Afronanny View Post
It's very likely that the purple can only be used by the Monoculus. I will check this out further tomorrow, but what you want to manipulate is likely inside the player_death event.
Well hopefully something can be done to allow people to make plugins that give admins/donators/what-have-you the purple name.

Think of the possibilities, I mean, the usability of a purple name would be cool for some gameplay mods like Super Zombie Fortress (zombies names are purple on the kill-icon-thingy for example).
404UserNotFound is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-13-2012 , 11:24   Re: SendProxy Manager
Reply With Quote #68

Quote:
Originally Posted by Afronanny View Post
It's very likely that the purple can only be used by the Monoculus. I will check this out further tomorrow, but what you want to manipulate is likely inside the player_death event.
tf2_stocks.inc
Code:
enum 
{ 
 TF_CUSTOM_HEADSHOT = 1, 
 TF_CUSTOM_BACKSTAB
 -snip-
 TF_CUSTOM_PRACTICE_STICKY, 
 TF_CUSTOM_EYEBALL_ROCKET
};
Hint hint?
__________________

Last edited by napalm00; 02-13-2012 at 11:25.
napalm00 is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-12-2012 , 09:58   Re: SendProxy Manager
Reply With Quote #69

PHP Code:
public OnPluginStart()
{
    
RegConsoleCmd("sm_hookme"HookIt);
}

public 
Action:HookIt(clientargs)
{
    
SendProxy_Hook(client"m_survivorCharacter"Prop_IntCharacterCallback);
}

public 
Action:CharacterCallback(entity, const String:propname[], &iValueelement)
{
    
LogToFileEx("testlog""CharacterCallback(entity %d, iValue %d, element %d)"entityiValueelement);
    
    return 
Plugin_Continue;

Game L4D2 windows, this crashes immediatly upon calling the console command, there is no log made.

Last edited by AtomicStryker; 03-12-2012 at 09:58.
AtomicStryker is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 04-02-2012 , 16:22   Re: SendProxy Manager
Reply With Quote #70

PHP Code:
sharesys->RegisterLibrary(myself"sendproxy"); 
pls

I want to use LibraryExists("sendproxy") instead of
CanTestFeatures() && GetFeatureStatus(FeatureType_Native, "SendProxy_HookArrayProp" == FeatureStatus_Available)

edit: also:
PHP Code:
#if !defined REQUIRE_EXTENSIONS
public __ext_sendproxymanager_SetNTVOptional()
{
    
MarkNativeAsOptional("SendProxy_Hook");
    
MarkNativeAsOptional("SendProxy_HookArrayProp");
    
MarkNativeAsOptional("SendProxy_Unhook");
    
MarkNativeAsOptional("SendProxy_IsHooked");
    
MarkNativeAsOptional("SendProxy_HookPropChange");
    
MarkNativeAsOptional("SendProxy_UnhookPropChange");
}
#endif 
__________________
einmal mit profis arbeiten. einmal.

Last edited by Thrawn2; 04-02-2012 at 16:56.
Thrawn2 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 01:52.


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