Raised This Month: $32 Target: $400
 8% 

[Hidden:Source] Visibility


Post New Thread Reply   
 
Thread Tools Display Modes
treminaor
Junior Member
Join Date: Jun 2013
Old 06-19-2013 , 19:30   Re: [Hidden:Source] Visibility
Reply With Quote #31

Quote:
Originally Posted by Dragonman326 View Post
Where would the plugins folder? i have the Hidden folder in C:\Srcds\Hidden but when i look in Hidden there is no plugins folder? Do i create one and drop this plugin in there?
You have to install sourcemod admin first, then use it's plugin folder which can be found here: C:\srcds\hidden\addons\sourcemod\plugins.

Read the server admin guide: http://forum.hidden-source.com/showt...x-Server-Guide
treminaor is offline
Fillask
Junior Member
Join Date: Sep 2013
Old 09-23-2013 , 16:10   Re: [Hidden:Source] Visibility
Reply With Quote #32

Hiya guys, time to liven up this topic again.

First off I'd like to thank you, paegus, for all the work you've put into the Hidden; I truly appreciate it.

Now then, I've recently started hosting my own server and subsequently (and inevitably, really) started tweaking it, including the visibility command. However, me being me I also decided I wanted the hidden to have the ability to 'hide' amongst the IRIS players, so I compiled another version of the visibility plugin under a different name and changed the command from +visible to +disguised, I changed the model and I decided to try it out.

The interesting thing is that it actually works from the first try. The other interesting thing is that it has also, to some extent, overridden the original plugin; I use different commands, but both turn me into an IRIS without a gun. Now this is fine, to be honest, but I would truly like it if the hidden were able to do both.

My theory is that the base codes of both plugins are so similar that the codes somehow refer to one another and that the newer plugin has somehow gained priority and the model therein has therefore become the go-to model for both commands.

Is there any way you can think of that might make both possible?

Also, would it be able to add a gun to the IRIS model? I realise that this might be a stretch, but one can hope.

Much obliged,

Fillask
Fillask is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 09-24-2013 , 01:12   Re: [Hidden:Source] Visibility
Reply With Quote #33

You probably want to just change all the convars from hsm_vis* to hsm_dis*

To give/take a gun take a look at the autobot plugin, since that force shotties or 303s. There's also the original (and somehow broken) phys vs plugin.

Remember to nick his ammo!

e: Alternatives
1: You could have multiple hsm_vis_model convars and each +/- combo uses a different model
+/-visible = hsm_vis_model = default
+/-disguise = hsm_vis_model_disguise = IRIS + weapon
+/-jimmeh = hsm_vis_model_jimmy = jimmy model.
etc...

2: you could have a list of models (based in the models folder so you can fit more in the string and use +/-visible # to pick which model to use.
hsm_vis_models "path/to/hidden,path/to/iris,path/to/barrel,path/to/jimmeh"
+visible or +visible 1 would use the 1st model in the list. +visible 2 would use the 2nd model, and so on.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 09-24-2013 at 05:32.
paegus is offline
Fillask
Junior Member
Join Date: Sep 2013
Old 09-24-2013 , 13:51   Re: [Hidden:Source] Visibility
Reply With Quote #34

Just now I tried changing all the hsm_vis to hsm_dis, but to no avail.
If you can be bothered to take a look, I've attached the file that I'm working with right now; you will most certainly see something I missed.

Kind regards,

Fillask

EDIT: To no avail meaning that both the +visible and +disguise commands turn my model into an IRIS one.
Attached Files
File Type: sp Get Plugin or Get Source (hsm_disguise.sp - 303 views - 12.5 KB)

Last edited by Fillask; 09-24-2013 at 13:52.
Fillask is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 09-25-2013 , 01:24   Re: [Hidden:Source] Visibility
Reply With Quote #35

It doesn't look like you've changed much... try replacing the OnPluginStart with this:

PHP Code:
public OnPluginStart() {
    
CreateConVar(
        
"hsm_dis_version",
        
PLUGIN_VERSION,
        
"H:SM - Disquise Version",
        
FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY
    
)
    
    
cvarVIS CreateConVar(
        
"hsm_dis",
        
cszVisTogEnable,
        
"Enable or disable Hidden's visibility toggle.",
        
_,
        
true0.0,
        
true1.0
    
)
    
    
cvarMINTIME CreateConVar(
        
"hsm_dis_mintime",
        
cszMinVisTime,
        
"Minimum number of seconds that hidden appears for when toggling visibility.",
        
_,
        
true0.1,
        
true2.0
    
)
    
    
cvarVISMODEL CreateConVar(
        
"hsm_dis_model",
        
cszVisModelFile,
        
"Model file to use for visible hidden player."
    
)
    
    
cvarCHATTIME FindConVar("mp_chattime")
    
    
RegConsoleCmd ("+disguise"cmd_Disguised"Makes Hidden player visible using model defined by hsm_vis_model")
    
RegConsoleCmd ("-disguise"cmd_Normal"Makes Hidden player invisible again.")
    
    
HookConVarChange(cvarVISconvar_Change)
    
HookConVarChange(cvarMINTIMEconvar_Change)
    
HookConVarChange(cvarVISMODELconvar_Change)
    
    if (
GetConVarFloat(cvarVIS) > 0) {
        
gbVistog true
        HookEventEx
("game_round_start",    event_RoundStart)
        
HookEventEx("game_round_end",    event_RoundEnd,        EventHookMode_Pre)
        
HookEventEx("player_hurt",        event_PlayerHurt,    EventHookMode_Pre)
    } else {
        
gbVistog false
    
}
    

__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
Fillask
Junior Member
Join Date: Sep 2013
Old 09-25-2013 , 05:41   Re: [Hidden:Source] Visibility
Reply With Quote #36

Aye, I know. I'm far from a proper programmer, just simply interested with a decent knowledge of HTML; it's like reading Latin when you know Spanish: you recognise some of the stuff, but you're far from being able to formulate proper sentences

In any case, it worked! Thanks ever so much!
I added a couple of bots to work as my cover and my friend had one hell of a time trying to find me.

The one thing that gave it away was my lack of a weapon.
You said that auto-bot could help with that, but:
a. isn't that just for bots?
b. even though I may change my model, I'm still the hidden; if the plugin does indeed force everyone to use shotguns/303's, that shouldn't mean that I would get a shotgun too, right?

If, at any point, you don't feel like helping with this because of the time/effort, that's just fine. Being able to switch between 3 different models is the cake; the gun would simply be the cherry on top.

Once again, thanks for your help!

Regards,

Fillask
Fillask is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 09-26-2013 , 02:20   Re: [Hidden:Source] Visibility
Reply With Quote #37

The autobot/phys vs plugins wont help directly. They do however contain code for giving and taking weapons is all.

Take a look, I think they're fairly decently commented?
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
Fillask
Junior Member
Join Date: Sep 2013
Old 09-26-2013 , 14:03   Re: [Hidden:Source] Visibility
Reply With Quote #38

Hiya,

They are indeed quite well commented in the sense that I'm fairly confident I have found the bits of code that I need. However, I truly lack the knowledge to adapt them in such a way that I adapt them to the disguise plugin.

For getting the shotgun I'm assuming I'd be needing:
PHP Code:
}

public 
event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast) {
    for (new 
1<= MaxClientsi++) {
        if (
            
IsClientInGame(i) &&                    // Connected and in-game
            
IsPlayerAlive(i) &&                        // Alive
            
GetClientTeam(i) == HDN_TEAM_IRIS &&    // IRIS
            
IsFakeClient(i)                            // A bot
        
) {
            
SetEntProp(iProp_Send"m_iNewClass"0);        // Set as Assault.
            
SetEntProp(iProp_Send"m_iPrimary"2);        // Set shotgun.
            
SetEntData(ig_osAmmoShotgun32true);        // Give ammo.
            
GivePlayerItem(i"weapon_shotgun");            // Give shotgun
            
FakeClientCommand(i"use weapon_shotgun");        // Use shotgun.
        
}
    }

Somehow changed in a such a way that it responds to cmd_Disguise, that I'm not a bot, and on team Hidden.

As for removing the shotgun, I think I would be needing this bit:

PHP Code:
}

public 
event_RoundStartHandle:event, const String:name[], bool:dontBroadcast) {
    if (
GetConVarInt(cvarPVP) == 1) {    // PVP mode enabled
        
for (new iClient 1iClient <= MaxClientsiClient++) {
            if (
                
IsClientInGame(iClient) &&
                
IsPlayerAlive(iClient)
            ) {
                
decl iWeapon;
                if (
GetClientTeam(iClient) == HDN_TEAM_IRIS) {
                    
// Strip primary weapons
                    
iWeapon GetPlayerWeaponSlot(iClient,0);
                    
RemovePlayerItem(iClientiWeapon);
                    
RemoveEdict(iWeapon);
                    
                    
ClientCommand(iClient"slot2");
                    
                    
                    
decl secAmmoOffset;
                    if (
GetEntProp(iClientProp_Send"m_iSecondary") == 0) {
                        
secAmmoOffset FindSendPropOffs("CSDKPlayer","m_iAmmo") + 4
                    
} else {
                        
secAmmoOffset FindSendPropOffs("CSDKPlayer","m_iAmmo") + 5
                    
}
                    
SetEntData(iClientsecAmmoOffset64true)
                    
                    
                } else {
                    
// Strip any grenades.
                    
iWeapon GetPlayerWeaponSlot(iClient,1);
                    
//LogToGame("No nades: %d", iWeapon);
                    
if (iWeapon 0) {
                        
RemovePlayerItem(iClientiWeapon);
                        
RemoveEdict(iWeapon);
                    }
                }
            }
        }
    }

My problem, though, is that there are a multitude of small references to things you put into the plugin at an earlier stage and I have no idea what's relevant and what I would have to put in the disguise plugin to make it all work.
Should you feel inclined to help me once more, I would be ever so grateful.
If not, then that's just fine as well; I'll most certainly be able to make do with the disguise plugin as it is.

Kind regards,

Fillask
Fillask is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 09-30-2013 , 07:43   Re: [Hidden:Source] Visibility
Reply With Quote #39

Unfortunately I don't really have the time to try and combine them at the moment.

You could try asking in the H:S forum thread here as there are/were other sourcemodders who might be willing to do it for you... and have the time.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
Fillask
Junior Member
Join Date: Sep 2013
Old 10-16-2013 , 06:04   Re: [Hidden:Source] Visibility
Reply With Quote #40

Meh, I tried to post on the other forum, but I got the message that the post would have to be approved by a moderator. That was pretty much 2 weeks ago.. :<
Fillask 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 11:00.


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