[CS:GO] mp_respawn_immunitytime for humans only?
I am using mp_respawn_immunitytime and it works great and gives immunity for the specified time and has an OK looking effect, but I would like it to apply to only humans instead of the default bot and humans having immunity.
Any ideas on how to write a plugin to do this? tx |
Re: [CS:GO] mp_respawn_immunitytime for humans only?
i don't think there is built in cvar that will only give protection to humans
use a plugin instead |
Re: [CS:GO] mp_respawn_immunitytime for humans only?
PHP Code:
|
Re: [CS:GO] mp_respawn_immunitytime for humans only?
Ilusion9,
thanks for the post. The plugin gives an error on this line: property is not a float value SetEntPropFloat() I changed it to SetEntProp() And for testing removed the check for bots so everyone should be getting immunity and my logging shows it is being called, but no one does. ?? |
Re: [CS:GO] mp_respawn_immunitytime for humans only?
PHP Code:
|
Re: [CS:GO] mp_respawn_immunitytime for humans only?
Ilusion9,
1) Test one mp_respawn_immunitytime 360 and no plugin. Everyone has immunity until they fire a weapon. 2) Test two. mp_respawn_immunitytime 360 and this plugin #include <sourcemod> public void OnPluginStart() { HookEvent("player_spawn", Event_PlayerSpawn); } public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); if (!client) return; new String:cname[255]; GetClientName(client, cname, 255); PrintToChatAll("Removing Immunity from %s", cname); SetEntProp(client, Prop_Send, "m_bGunGameImmunity", false); SetEntPropFloat(client, Prop_Send, "m_fImmuneToGunGameDamageTime", 0.0); } Everyone has immunity until they fire a weapon. I would expect immunity to be removed from everyone but everyone still has immunity. I know the player spawn is runing because of the messages are printed. ?? |
Re: [CS:GO] mp_respawn_immunitytime for humans only?
What I gave you:
PHP Code:
PHP Code:
|
Re: [CS:GO] mp_respawn_immunitytime for humans only?
Ilusion9,
I should have explained what I was doing better. I only hinted at it when I said about my example “I would expect immunity to be removed from everyone…” When learning a new SM concept or code and it isn’t working I like to condense it down to the smallest possible bit of code to try to debug it. Since my example only returns on an invalid client I would expect the two SetEntProp() to run on everyone, all players all teams to remove immunity and my PrintToChat() shows all players at round start so I know those lines are being applied to all connected players, but everyone always gets immunity so calling those two lines on a client in Player_Spawn() doesn’t remove immunity. At least not in CSGO. And I tried the converse to set immunity and it doesn’t work either. SetEntProp(client, Prop_Send, "m_bGunGameImmunity", true); SetEntPropFloat(client, Prop_Send, "m_fImmuneToGunGameDamageTime", 60.0); |
All times are GMT -4. The time now is 02:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.