AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Solved] Prevent damage w/o Godmode (https://forums.alliedmods.net/showthread.php?t=325570)

MaNaReaver 06-27-2020 10:01

[Solved] Prevent damage w/o Godmode
 
Hey AM,

I wanted to know if there's a way to prevent damage from other team, without having godmode set. Thanks for the assistance!

Best regards.

supertrio17 06-27-2020 10:17

Re: Prevent damage w/o Godmode
 
Why not use godmode, give us a little bit more detail. Why is amx_godmode bad?

MaNaReaver 06-27-2020 10:21

Re: Prevent damage w/o Godmode
 
Quote:

Originally Posted by supertrio17 (Post 2707521)
Why not use godmode, give us a little bit more detail. Why is amx_godmode bad?

I have a zombie bot that does damage to both teams, but I don't want players to kill each other instead of the zombie. It's a point based game, that awards points on killing zombies. So setting everyone to the same team doesn't do good.

I was thinking of using the hitpoint plugin to reduce the damage to 0, but that would also prevent damage to zombie.

supertrio17 06-27-2020 10:25

Re: Prevent damage w/o Godmode
 
Do you mind sharing zombie bot plugin with us, its way easier to edit that plugin than make a new one.

MaNaReaver 06-27-2020 10:29

Re: Prevent damage w/o Godmode
 
Quote:

Originally Posted by supertrio17 (Post 2707524)
Do you mind sharing zombie bot plugin with us, its way easier to edit that plugin than make a new one.

Sorry, it's private and under the works, so I don't think I'll be able to share it right now.

supertrio17 06-27-2020 10:31

Re: Prevent damage w/o Godmode
 
Well if it is private, than it means you made it? So I could make a code and you could implement it in your code :) . Seems fair

supertrio17 06-27-2020 11:23

Re: Prevent damage w/o Godmode
 
Quote:

Originally Posted by MaNaReaver (Post 2707515)
Hey AM,

I wanted to know if there's a way to prevent damage from other team, without having godmode set. Thanks for the assistance!

Best regards.

I was overthinking it, it's quite simple. But be aware that god_mode will disappear only when map changes, thas why I said use it in the plugin itself. If you need help when implementing this in your plugin, you are free to tell me :)
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define VERSION "1.3"

public plugin_init() 
{
    
register_plugin("Something like a GodMode"VERSION"Mr. Boopsy");
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1);
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
set_user_godmode(id1);
    }


Tested on bots!

MaNaReaver 06-27-2020 11:59

Re: Prevent damage w/o Godmode
 
Quote:

Originally Posted by supertrio17 (Post 2707539)
I was overthinking it, it's quite simple. But be aware that god_mode will disappear only when map changes, thas why I said use it in the plugin itself. If you need help when implementing this in your plugin, you are free to tell me :)
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define VERSION "1.3"

public plugin_init() 
{
    
register_plugin("Something like a GodMode"VERSION"Mr. Boopsy");
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1);
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
set_user_godmode(id1);
    }


Tested on bots!

A friend of mine and I've been working on it, that's why I'm unable to publically share the plugin as of now. Also, this is basically a godmode implementation, and I can't use this as the zombie bot does damage when it comes in contact to the player. Thanks though, appreciate your time on helping me out with this.

supertrio17 06-27-2020 12:00

Re: Prevent damage w/o Godmode
 
Okay, I'll try and figure out something else :)

MaNaReaver 06-27-2020 12:03

Re: Prevent damage w/o Godmode
 
Quote:

Originally Posted by supertrio17 (Post 2707549)
Okay, I'll try and figure out something else :)

Thanks again! :wink:


All times are GMT -4. The time now is 11:42.

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