AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Poof (https://forums.alliedmods.net/showthread.php?t=160740)

blackalegator 06-29-2011 19:16

[ANY] Poof
 
2 Attachment(s)
  • Title: Poof
  • Description
This is my first plugin. Originally made for left 4 dead 2 it may be used on any game. Features:
- Makes a player fully invisible
- Hides player's nickaname on top of his head
- All the attached models dissapear (In left 4 dead 2 even the light attached to survivors body dissapears)
- It dhould work on any gamemode, though maybe I will add left4dead-only features soon
  • Commands
- sm_poof
- poof
(for yourself only)
- sm_poof <userid/name>
- poof <userid/name>
(For targeting someone else)
- !poof in chat works too

  • Dependencies
SDKhooks
  • Changelog
30.06.2011 (1.0)
- Plugin realease
30.06.2011 (1.01)
-Removed player renaming. Currently I didnt find any otption of making your nickanme invisible except doing it manually in steam settings. Change your nickname in stem to:
"~" at the beginning, maximum ammount of spaces possible in the middle and "." at the end

30.06.2011(1.1)
-Fixed multiplayer support. It is now safe to use poof for more than 1 person

30.06.2011(1.2)
- Nearly all my code wasnt needed xD. Thank silvers, code is now clean and nickname is hidden. Though Ive got a lot of experience writing this first plugin.

30.06.2011(1.21)
- Sorry! Forgot about checking for poof state enabled per client. Fixed now

1.06.2011(1.3)
- Multitargeting
- Cleaned and commented all the code

3.06.2011(1.31)
- Fixed a bug where player wasnt able to go back from invisibility state if he was not using any arguments

-Removed usseless log (In poofcheck=0 state)

4.08.2011(1.35)
- No more Warnings in compilation
- Made IsValidClient function look prettier
  • Installation Instructions
- Install SDKhooks
- Place poof.smx at your plugins folder
  • Plans
//Add a possibility to hide all the clients from one client
(Maybe later...)
Thanks:
- Special thanks to MatthiasVance and some other guys from IRC channel!
If not you, my first plugin would never be released!
- Thank you Silvers for your code!

alexip121093 06-29-2011 20:59

Re: [L4D2] Poof
 
I dont know why you using this script to make invisible

sdkhook settransmit work great. can hide the player name too

blackalegator 06-30-2011 03:37

Re: [L4D2] Poof
 
Quote:

Originally Posted by alexip121093 (Post 1499978)
I dont know why you using this script to make invisible

sdkhook settransmit work great. can hide the player name too

Thanks! Going to change that today. BTW I havent read about settransmit yet, but maybe infected will be still able to see your hud.

blackalegator 06-30-2011 07:56

Re: [L4D2] Poof
 
Quote:

Originally Posted by alexip121093 (Post 1499978)
I dont know why you using this script to make invisible

sdkhook settransmit work great. can hide the player name too


Could you please explain how to do it a bit more? If I hook a client he is not able to move/shoot at all. Or there is a way to hook clients nickname?

blackalegator 06-30-2011 08:55

Re: [L4D2] Poof
 
Okay... It seems like there is no way to make player's name invisible excepth setting it in steam settings. Ive tried Sdkhooks settransmit, NULL_STRING for player's name and a bunch of other ideas.
Anyways, Ill finish plans written on the main thread and it will be over for development

Silvers 06-30-2011 08:57

Re: [L4D2] Poof
 
You dont need to change the players name, SDKHooks blocks the players model completely, youre just doing it wrong.

blackalegator 06-30-2011 10:51

Re: [L4D2] Poof
 
Quote:

Originally Posted by Silvers (Post 1500296)
You dont need to change the players name, SDKHooks blocks the players model completely, youre just doing it wrong.

Well Ill show you what Ive tried to do with SDKhooks:

PHP Code:

SDKHook(clientSDKHook_SetTransmitHook_SetTransmit);

public 
Action:Hook_SetTransmit(cliententity)
{
    return 
Plugin_Handled;


This made invisible player to stuck. He wasnt able to move, shoot or do whatsoever

Silvers 06-30-2011 10:56

Re: [L4D2] Poof
 
Try this:
PHP Code:

SDKHook(clientSDKHook_SetTransmitHook_SetTransmit);

public 
Action:Hook_SetTransmit(cliententity)
{
    if( 
client == entity )
        return 
Plugin_Continue;
    return 
Plugin_Handled;



blackalegator 06-30-2011 13:27

Re: [L4D2] Poof
 
Quote:

Originally Posted by Silvers (Post 1500384)
Try this:
PHP Code:

SDKHook(clientSDKHook_SetTransmitHook_SetTransmit);

public 
Action:Hook_SetTransmit(cliententity)
{
    if( 
client == entity )
        return 
Plugin_Continue;
    return 
Plugin_Handled;



Could You please explain me this code a little bit? Isnt client allways an entity? Than it would have no effect

Silvers 06-30-2011 15:04

Re: [L4D2] Poof
 
Quote:

Originally Posted by blackalegator (Post 1500489)
Could You please explain me this code a little bit? Isnt client allways an entity? Than it would have no effect

You SetTransmit hook on an entity, usually a prop_dynamic or something. The transmit callback is fired for that prop_dynamic entity (or in this case the client) and fires every frame for all clients. You can then decide who should see that entity by return Plugin_Continue or not allowed to see that entity with return Plugin_Handled.

Because the entity you hooked is a client, all you have to do is check the entity and client are the same and allow that person to see themselves (so they can move etc), while they are blocked to everyone else.


All times are GMT -4. The time now is 22:55.

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