Using invisible for spawn protection.
I am working on a spawn protection plugin that makes the player invisible for the protection period.
This seems like a much better way to handle it instead of letting the player take damage but then ignore the damage. I found this plugin in and with just a few lines it hides all players from a single player and it works great but, I need to do the opposite, hide a single player from all players. https://forums.alliedmods.net/showthread.php?t=236806 Does anyone have a suggestion on how to modify it to work this way? |
Re: Using invisible for spawn protection.
PHP Code:
|
Re: Using invisible for spawn protection.
What is this function?
IsEntityClient(entity) Here is what I have and it doesn't work. I am on an all bot server and trying to hide from bots as testing. Does this work for hiding from bots? Thanks! PHP Code:
|
Re: Using invisible for spawn protection.
To check, is it player index, look entity indexs range 1 to MaxClients.
0 is console or error. Entity index > MaxClients are rest things. After confirm it is valid player index, to check, is player using player index: IsClientInGame(index) |
Re: Using invisible for spawn protection.
Bacardi,
Right! Got it! Thanks. I modified my plugin (and my example above) by adding this (0 < entity <= MaxClients) But still no joy. When I spawn into my bot server I don't move or buy anthing so I make no noise, I turn on the portection but the bots still see me. I know the if statment is working. Since I am the first player on the server I get client index of 1 and my logging is showing after I turn on protection it starts printing * 1s Maybe this method doesn't work with bots? |
Re: Using invisible for spawn protection.
SetTransmit only prevents the model to be drawn to the client, collision and AI still works on the hidden client.
|
Re: Using invisible for spawn protection.
Marttt
thanks for the info, that explains it. this method can't be used to hide from bots...... |
Re: Using invisible for spawn protection.
I am running bot servers so I am really only interested in hiding players for a short time from bots after spawning into a random location.
I have been thinking about this and would really like to get “invisible” spawn protection going since it is far better than ignoring damage taken and just realized players are “invisible” to bots in two situations. 1) When they are flashed 2) When the player is covered in smoke. What functionality in the Source engine provides these features and can we hack them into getting something at least close to what we want? It would be cool if we could trick the bots into thinking we are covered in smoke when we are not! And again since this is spawn protection it only has to work for a shot time around a player not moving. A really cheap way to do it would be to ignite smoke around the player 2-3 times to last the duration of the protection but I would prefer to avoid the smoke effect and just have the bot go by ignoring the human player thinking there is smoke there or whatever effect we can use to get this done. The smoke effect seems to be the perfect choice since it is about the right size around the player and lasts for only a short while. Invisible smoke is what we need! Any advanced codes have any ideas? |
All times are GMT -4. The time now is 17:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.