Raised This Month: $ Target: $400
 0% 

Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version


Post New Thread Reply   
 
Thread Tools Display Modes
madex
Junior Member
Join Date: Jul 2011
Old 07-16-2011 , 14:01   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #281

Possible work without download sprites ?
madex is offline
cryses108
Member
Join Date: Jul 2011
Location: De_dust2
Old 11-13-2011 , 06:24   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #282

A little problem detected: It shows that everyone is using wallhack :/ please fix
cryses108 is offline
Send a message via Skype™ to cryses108
jppmarujo
Junior Member
Join Date: Nov 2011
Location: Portugal
Old 11-16-2011 , 00:03   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #283

Hello.

Actually, i had the lucky chance of talking to joaquimandrade. He is, fortunately, very busy with personal and professional issues that consume most of his time.

I run a Community with many games attached (1.6 , CZ, Source and TF2) and we, to give privilege to organization, use AMXBans and Source Bans to keep things going smoothly.

So, i'm not absolute sure why this happens, but it seems that enabling the sqlite in modules.ini does get the plugin to work, but it causes conflicts with AMXBans database.

I talked to Joaquim to ask him about the possibility of re-writing this to be compatible with AMXBans and he is, in terms of personal time, not able to make this. The advice he gave me was to come here and ask if any of you is capable of making Peeping Tom 2 compatible with AMXBans?

I would be really grateful, even though not being really sure how that gratitude could pay for others time and effort...

Last edited by jppmarujo; 11-16-2011 at 00:05.
jppmarujo is offline
Old 11-16-2011, 02:46
naeT1eixol
This message has been deleted by psychonic. Reason: spambot
bibu
Veteran Member
Join Date: Sep 2010
Old 11-16-2011 , 14:04   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #284

What has this todo with a ban plugin? You simple watch a player and ban him with another external ban plugin.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
jppmarujo
Junior Member
Join Date: Nov 2011
Location: Portugal
Old 11-16-2011 , 15:00   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #285

bibu,

I'm not sure why that happens, but it seems that sqlite database interferes with AMXBans database. So, everytime i enable sqlite in modules.ini, AMXBans stops working and the server crashes.

I can't tell you why this happens because, lets be honest, i'm not even close to being an expert on this matter, but it does happen.

I talked to joaquim about this and he told me to come here and try to find a solution in team-work with you guys.


Thank you for your answer.
jppmarujo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 11-17-2011 , 16:50   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #286

I have no idea if this works. Otherwise the sql part should be completely removed.

Try this:

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

#include <cstrike>

#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>

#include <xs>

#define CanUseAlive 0

new const Plugin[] = "Peeping Tom - Jack86"
new const Author[] = "joaquimandrade"
new const Version[]    = "2.0"

new SpritesPath[CsTeams][] = {"","sprites/peeping_tom/t.spr","sprites/peeping_tom/ct.spr",""}
new 
SpritesCachedIDs[CsTeams]

const 
MaxSlots 32

new bool:OnFirstPersonView[MaxSlots+1]
new 
HasPermissions[MaxSlots+1]

new 
SpectatingUser[MaxSlots+1]

const 
PermissionFlag ADMIN_BAN

enum _
:Vector
{
    
X,
    
Y,
    
Z
}

enum Individual
{
    
Spectated,
    
Viewed
}

enum OriginOffset
{
    
FrameSide,
    
FrameTop,
    
FrameBottom,
}

enum FramePoint
{
    
TopLeft,
    
TopRight,
    
BottomLeft,
    
BottomRight
}

new 
Float:OriginOffsets[OriginOffset] =  {_:13.0,_:25.0,_:36.0}

new 
Float:ScaleMultiplier 0.013;
new 
Float:ScaleLower 0.005

new Float:SomeNonZeroValue 1.0

new EntitiesOwner

new MaxPlayers

enum StateViewOption
{
    
StateViewSpec,
#if CanUseAlive
    
StateViewAlways,
#endif
    
StateViewDisabled

}

enum TeamViewOption
{
    
TeamViewEnemies,
    
TeamViewEverybody
}

enum _:Option
{
    
OptionStateView,
    
OptionTeamView
}

new 
OptionValuesLabels[Option][][] =
{
    {
    
"Spectator",
#if CanUseAlive
    
"Always",
#endif
    
"Disabled"
    
},
    
    {
    
"Enemies",
    
"Everybody"
#if CanUseAlive
    
,""
#endif
    
}
}

new 
OptionLabels[][] = 
{
    
"State",
    
"View"
}

new 
OptionsLen[Option] = {_:StateViewOption,_:TeamViewOption}

new 
UserOptions[MaxSlots+1][Option]

new Array:
SteamIDsList
new Trie:SteamIDToListID
new Array:PlayerOptionsOriginal
new Array:PlayerOptionsFinal

new PlayerListID[MaxSlots+1]

#if !CanUseAlive 
new ForwardAddToFullPack
new OnFirstPersonViewN
#endif

public plugin_precache()
{
    for(new 
CsTeams:i=CS_TEAM_T;i<=CS_TEAM_CT;i++)
        
SpritesCachedIDs[i] = precache_model(SpritesPath[i])
}

public 
plugin_init()
{
    
register_plugin(Plugin,Version,Author)
    
    
register_event("TextMsg","specMode","b","2&#Spec_Mode")
    
register_event("StatusValue","specTarget","bd","1=2")
    
register_event("SpecHealth2","specTarget","bd")
    
    
RegisterHam(Ham_Spawn,"player","playerSpawn",1)
    
    
register_clcmd("peepingTom","peepingTom",PermissionFlag)
    
    
register_cvar("peepingTom_version",Version,FCVAR_SERVER|FCVAR_SPONLY);
    
    
#if CanUseAlive
    
register_forward(FM_AddToFullPack,"addToFullPackPost",1)
    
#endif
}

public 
plugin_cfg()
{
    
EntitiesOwner create_entity("info_target")
    
    
MaxPlayers get_maxplayers()
    
    for(new 
id=1;id<=MaxPlayers;id++)
        
createSprite(id,EntitiesOwner)    
    
    
SteamIDsList ArrayCreate(34)
    
SteamIDToListID TrieCreate()
    
PlayerOptionsOriginal ArrayCreate(_:Option)
    
PlayerOptionsFinal ArrayCreate(_:Option)
}

public 
createSprite(aiment,owner)    
{
    new 
sprite create_entity("info_target")
    
    
assert is_valid_ent(sprite);
    
    
entity_set_edict(sprite,EV_ENT_aiment,aiment)    
    
set_pev(sprite,pev_movetype,MOVETYPE_FOLLOW)
    
    
entity_set_model(sprite,SpritesPath[CS_TEAM_T])
    
    
set_pev(sprite,pev_owner,owner)

    
set_pev(sprite,pev_solid,SOLID_NOT)
    
    
fm_set_rendering(sprite,.render=kRenderTransAlpha,.amount=0)    
}

public 
addToFullPackPost(eseenthosthostflagsplayerpSet)
{
    
#if CanUseAlive
    
if((1<=host<=MaxPlayers) && ((UserOptions[host][OptionStateView] == _:StateViewSpec) && ((OnFirstPersonView[host] && SpectatingUser[host])) || (UserOptions[host][OptionStateView] == _:StateViewAlways)) && is_valid_ent(ent))
    
#else
    
if((1<=host<=MaxPlayers) && (UserOptions[host][OptionStateView] == _:StateViewSpec) && ((OnFirstPersonView[host] && SpectatingUser[host])) && is_valid_ent(ent))
    
#endif
    
{        
        if(
pev(ent,pev_owner) == EntitiesOwner)
        {
            if(
engfunc(EngFunc_CheckVisibility,ent,pSet))
            {
                new 
spectated OnFirstPersonView[host] ? SpectatingUser[host] : host
                
                
new aiment pev(ent,pev_aiment)
                
                static 
CsTeams:team
                
                
if((spectated != aiment) && is_user_alive(aiment) && ((cs_get_user_team(spectated) != (team=cs_get_user_team(aiment))) || (UserOptions[host][OptionTeamView] == _:TeamViewEverybody)))
                {
                    static 
ID[Individual]
        
                    
ID[Spectated] = spectated
                    ID
[Viewed] = ent
                    
                    
static Float:origin[Individual][Vector]
                    
                    
entity_get_vector(ID[Spectated],EV_VEC_origin,origin[Spectated])
                    
get_es(es,ES_Origin,origin[Viewed])
                    
                    static 
Float:diff[Vector]
                    static 
Float:diffAngles[Vector]
                    
                    
xs_vec_sub(origin[Viewed],origin[Spectated],diff)            
                    
xs_vec_normalize(diff,diff)         
                    
                    
vector_to_angle(diff,diffAngles)
                    
                    
diffAngles[0] = -diffAngles[0];
                    
                    static 
Float:framePoints[FramePoint][Vector]
                    
                    
calculateFramePoints(origin[Viewed],framePoints,diffAngles)            
                    
                    static 
Float:eyes[Vector]
                    
                    
xs_vec_copy(origin[Spectated],eyes)
                    
                    static 
Float:viewOfs[Vector]            
                    
entity_get_vector(ID[Spectated],EV_VEC_view_ofs,viewOfs);
                    
xs_vec_add(eyes,viewOfs,eyes);
                    
                    static 
Float:framePointsTraced[FramePoint][Vector]
                    
                    static 
FramePoint:closerFramePoint
                    
                    
if(traceEyesFrame(ID[Spectated],eyes,framePoints,framePointsTraced,closerFramePoint))
                    {
                        static 
Float:otherPointInThePlane[Vector]
                        static 
Float:anotherPointInThePlane[Vector]
                        
                        static 
Float:sideVector[Vector]
                        static 
Float:topBottomVector[Vector]
                        
                        
angle_vector(diffAngles,ANGLEVECTOR_UP,topBottomVector)
                        
angle_vector(diffAngles,ANGLEVECTOR_RIGHT,sideVector)
                        
                        
xs_vec_mul_scalar(sideVector,SomeNonZeroValue,otherPointInThePlane)
                        
xs_vec_mul_scalar(topBottomVector,SomeNonZeroValue,anotherPointInThePlane)    
                        
                        
xs_vec_add(otherPointInThePlane,framePointsTraced[closerFramePoint],otherPointInThePlane)
                        
xs_vec_add(anotherPointInThePlane,framePointsTraced[closerFramePoint],anotherPointInThePlane)
                        
                        static 
Float:plane[4]
                        
xs_plane_3p(plane,framePointsTraced[closerFramePoint],otherPointInThePlane,anotherPointInThePlane)
                        
                        
moveToPlane(plane,eyes,framePointsTraced,closerFramePoint);
                        
                        static 
Float:middle[Vector]
                        
                        static 
Float:half 2.0
                        
                        xs_vec_add
(framePointsTraced[TopLeft],framePointsTraced[BottomRight],middle)
                        
xs_vec_div_scalar(middle,half,middle)
                        
                        new 
Float:scale ScaleMultiplier vector_distance(framePointsTraced[TopLeft],framePointsTraced[TopRight])
                        
                        if(
scale ScaleLower)
                            
scale ScaleLower;
                        
                        
set_es(es,ES_AimEnt,0)
                        
set_es(es,ES_MoveType,MOVETYPE_NONE)
                        
set_es(es,ES_ModelIndex,SpritesCachedIDs[team])
                        
set_es(es,ES_Scale,scale)
                        
set_es(es,ES_Angles,diffAngles)
                        
set_es(es,ES_Origin,middle)
                        
set_es(es,ES_RenderMode,kRenderNormal)
                    }
                }
            }
        }
    }
}

calculateFramePoints(Float:origin[Vector],Float:framePoints[FramePoint][Vector],Float:perpendicularAngles[Vector])
{
    new 
Float:sideVector[Vector]
    new 
Float:topBottomVector[Vector]
    
    
angle_vector(perpendicularAngles,ANGLEVECTOR_UP,topBottomVector)
    
angle_vector(perpendicularAngles,ANGLEVECTOR_RIGHT,sideVector)
    
    new 
Float:sideDislocation[Vector]
    new 
Float:bottomDislocation[Vector]
    new 
Float:topDislocation[Vector]
    
    
xs_vec_mul_scalar(sideVector,Float:OriginOffsets[FrameSide],sideDislocation)
    
xs_vec_mul_scalar(topBottomVector,Float:OriginOffsets[FrameTop],topDislocation)    
    
xs_vec_mul_scalar(topBottomVector,Float:OriginOffsets[FrameBottom],bottomDislocation)
    
    
xs_vec_copy(topDislocation,framePoints[TopLeft])
    
    
xs_vec_add(framePoints[TopLeft],sideDislocation,framePoints[TopRight])
    
xs_vec_sub(framePoints[TopLeft],sideDislocation,framePoints[TopLeft])
    
    
xs_vec_neg(bottomDislocation,framePoints[BottomLeft])
    
    
xs_vec_add(framePoints[BottomLeft],sideDislocation,framePoints[BottomRight])
    
xs_vec_sub(framePoints[BottomLeft],sideDislocation,framePoints[BottomLeft])
    
    for(new 
FramePoint:TopLeft<= BottomRighti++)
        
xs_vec_add(origin,framePoints[i],framePoints[i])
    
}

traceEyesFrame(id,Float:eyes[Vector],Float:framePoints[FramePoint][Vector],Float:framePointsTraced[FramePoint][Vector],&FramePoint:closerFramePoint)
{
    new 
Float:smallFraction 1.0
    
    
for(new FramePoint:TopLeft<= BottomRighti++)
    {
        new 
trace;
        
engfunc(EngFunc_TraceLine,eyes,framePoints[i],IGNORE_GLASS,id,trace)
        
        new 
Float:fraction
        get_tr2
(traceTR_flFraction,fraction);
        
        if(
fraction == 1.0)
        {
            return 
false;
        }
        else
        {
            if(
fraction smallFraction)
            {
                
smallFraction fraction
                closerFramePoint 
i;
            }
            
            
get_tr2(trace,TR_EndPos,framePointsTraced[i]);
        }
    }
    
    return 
true;
}

moveToPlane(Float:plane[4],Float:eyes[Vector],Float:framePointsTraced[FramePoint][Vector],FramePoint:alreadyInPlane)
{
    new 
Float:direction[Vector]
    
    for(new 
FramePoint:i=TopLeft;i<alreadyInPlane;i++)
    {
        
xs_vec_sub(eyes,framePointsTraced[i],direction)
        
xs_plane_rayintersect(plane,framePointsTraced[i],direction,framePointsTraced[i])
    }
    
    for(new 
FramePoint:i=alreadyInPlane+FramePoint:1;i<=BottomRight;i++)
    {
        
xs_vec_sub(eyes,framePointsTraced[i],direction)
        
xs_plane_rayintersect(plane,framePointsTraced[i],direction,framePointsTraced[i])
    }
}    
    
handleJoiningFirstPersonView(id)
{    
    
OnFirstPersonView[id] = true
    
    
#if !CanUseAlive 
    
if(!OnFirstPersonViewN++)
    {
        
ForwardAddToFullPack register_forward(FM_AddToFullPack,"addToFullPackPost",1)
    }
    
#endif
}

handleQuitingFirstPersonView(id)
{
    
OnFirstPersonView[id] = false
    SpectatingUser
[id] = 0
    
    
#if !CanUseAlive 
    
if(!--OnFirstPersonViewN)
    {
        
unregister_forward(FM_AddToFullPack,ForwardAddToFullPack,1)
    }
    
#endif
}

public 
playerSpawn(id)
{
    if(
HasPermissions[id])
    {
        if(
OnFirstPersonView[id] && is_user_alive(id))
        {
            
handleQuitingFirstPersonView(id)
        }
    }
}

public 
client_authorized(id)
{
    if(
get_user_flags(id) & PermissionFlag)
    {
        
HasPermissions[id] = true
        
        
static steamID[34]
        
get_user_authid(id,steamID,charsmax(steamID))
        
        new 
listID
        
        UserOptions
[id][OptionStateView] = UserOptions[id][OptionTeamView] = 0
        
        
if(!TrieGetCell(SteamIDToListID,steamID,listID))
        {
            
            
TrieSetCell(SteamIDToListID,steamID,ArraySize(SteamIDsList))
            
            
ArrayPushString(SteamIDsList,steamID)
            
            
ArrayPushArray(PlayerOptionsOriginal,UserOptions[id])
            
ArrayPushArray(PlayerOptionsFinal,UserOptions[id])
        }
        else
        {
            
ArrayGetArray(PlayerOptionsFinal,listID,UserOptions[id])
        }
        
        
PlayerListID[id] = listID
    
}
    else
    {
        
HasPermissions[id] = false
    
}
}

public 
client_disconnect(id)
{
    if(
HasPermissions[id])
    {
        if(
OnFirstPersonView[id])
        {
            
handleQuitingFirstPersonView(id)
        }
        
        
ArraySetArray(PlayerOptionsFinal,PlayerListID[id],UserOptions[id])
        
        
HasPermissions[id] = false
    
}
}

public 
specMode(id)
{
    if(
HasPermissions[id])
    {
        new 
specMode[12]
        
read_data(2,specMode,11)
            
        if(
specMode[10] == '4')
        {
            
handleJoiningFirstPersonView(id)
        }
        else if(
OnFirstPersonView[id])
        {
            
handleQuitingFirstPersonView(id)
        }
    }
}

public 
specTarget(id)
{
    new 
spectated read_data(2);
        
    if(
spectated)
    {
        if(
OnFirstPersonView[id])
        {
            if(
spectated != SpectatingUser[id])
            {
                
handleQuitingFirstPersonView(id)
                
SpectatingUser[id] = spectated;                
                
handleJoiningFirstPersonView(id)
            }
        }
        else
        {
            
SpectatingUser[id] = spectated;
        }
    }
}

public 
plugin_end()
{
    for(new 
i=0;i<ArraySize(SteamIDsList);i++)
    {
        new 
optionsOriginal[Option]
        new 
optionsFinal[Option]
        
        
ArrayGetArray(PlayerOptionsOriginal,i,optionsOriginal)
        
ArrayGetArray(PlayerOptionsFinal,i,optionsFinal)
        
        new 
sumOriginal
        
new sumFinal
        
        
for(new j=0;j<Option;j++)
        {
            
sumOriginal += optionsOriginal[j]
            
sumFinal += optionsFinal[j]
        }
    }
}

public 
peepingTom(id,level,cid
{
    if(
cmd_access(id,level,cid,0))
    {
        
peepingTomMenu(id)
        return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_CONTINUE
}

peepingTomMenu(id)
{    
    new 
menu menu_create("Peeping Tom User Options","handlePeepingTomMenu")
    
    new 
optionString[2]
    
    static 
itemFormat[] = "%s: ^"\r%s\w^""
    
static itemText[sizeof itemFormat 20 20]
    
    for(new 
i=0;i<Option;i++)
    {
        
optionString[0] = 48
        formatex
(itemText,charsmax(itemText),itemFormat,OptionLabels[i],OptionValuesLabels[i][UserOptions[id][i]])
        
        
menu_additem(menu,itemText,optionString)
    }
    
    
menu_display(id,menu)
}
public 
handlePeepingTomMenu(id,menu,item)
{
    if(
item >= 0
    {
        new 
accesscallback
        
        new 
actionString[2];        
        
menu_item_getinfo(menu,item,accessactionString,1,_,_callback);        
        new 
action str_to_num(actionString);    
        
        
UserOptions[id][action] = (UserOptions[id][action] + 1) % OptionsLen[action]
        
        
peepingTomMenu(id)        
    }
    
    
menu_destroy(menu)

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Daddy-K
Junior Member
Join Date: Jun 2010
Location: Romania/Mangalia
Old 11-20-2011 , 05:32   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #287

I have a little problem with this plugin:

Quote:
L 11/19/2011 - 20:56:23: [CSTRIKE] Invalid player 15
L 11/19/2011 - 20:56:23: [AMXX] Displaying debug trace (plugin "peepingTom2.amxx")
L 11/19/2011 - 20:56:23: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 11/19/2011 - 20:56:23: [AMXX] [0] 47147.attach::addToFullPackPost (line 2 8 8 )

Can you help me?

Last edited by Daddy-K; 11-20-2011 at 05:34.
Daddy-K is offline
jppmarujo
Junior Member
Join Date: Nov 2011
Location: Portugal
Old 11-20-2011 , 23:40   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #288

bibu,

Thank you! It actually worked.

I would offer you a Chocolate Cornetto, but i'm guessing it wouldn't last the whole trip.


Thanks again!
jppmarujo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 11-21-2011 , 13:21   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #289

Quote:
Originally Posted by jppmarujo View Post
bibu,

Thank you! It actually worked.

I would offer you a Chocolate Cornetto, but i'm guessing it wouldn't last the whole trip.


Thanks again!
I'm actually surprised and for sure glad that it works.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
K o T
Senior Member
Join Date: Jan 2011
Old 06-16-2012 , 11:17   Re: Peeping Tom 2 - Pseudo-Wallhack For Admins - Final Version
Reply With Quote #290

turn off Spectated
include command Spectated must the most
how to make Disabled
Quote:
{
StateViewDisabled,
#if CanUseAlive
StateViewSpec,
#endif
StateViewAlways

}

;)

Last edited by K o T; 06-24-2012 at 03:07.
K o T 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 22:35.


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