View Single Post
lightphoenix2
Member
Join Date: Feb 2016
Old 01-29-2021 , 16:05   Re: [L4D2] Setting Damage dealt to witch
Reply With Quote #13

Quote:
Originally Posted by Marttt View Post
Is because you can't compare strings like that:

This is the return of GetEntityClassname:

PHP Code:
Return Value
True on success
false if there is no classname set
https://sm.alliedmods.net/new-api/en...ntityClassname

In other worlds, since you are always passing a classname it will always returns true.

The correct what to check is doing like this.

PHP Code:
char classname[6]; //witch has a len of 5 + 1 for the terminator
GetEntityClassname(victimclassnamesizeof(classname)); 
Then you change your logic to:

PHP Code:
if (victim MaxClients && classname[0] == 'w' && StrEqual(classname"witch") && attacker && attacker <= MaxClients && IsClientInGame(attacker) && GetClientTeam(attacker) == && g_iLevel[attacker] > 0
I didn't test but may work.
Ah, from your explanation, it makes sense. I will try it out and let you know if it works.
lightphoenix2 is offline