40 lines
No EOL
1.2 KiB
SourcePawn
40 lines
No EOL
1.2 KiB
SourcePawn
//Simply prints the respected infected's class name based on their numeric id. (not client/user ID)
|
|
stock bool GetInfectedClassName(int type, char[] buffer, int bufferSize) {
|
|
switch(type) {
|
|
case 1: strcopy(buffer, bufferSize, "smoker");
|
|
case 2: strcopy(buffer, bufferSize, "boomer");
|
|
case 3: strcopy(buffer, bufferSize, "hunter");
|
|
case 4: strcopy(buffer, bufferSize, "spitter");
|
|
case 5: strcopy(buffer, bufferSize, "jockey");
|
|
case 6: strcopy(buffer, bufferSize, "charger");
|
|
default: return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
stock int GetDifficultyInt() {
|
|
char diff[16];
|
|
hZDifficulty.GetString(diff, sizeof(diff));
|
|
if(StrEqual(diff, "easy", false)) return 0;
|
|
else if(StrEqual(diff, "hard", false)) return 2;
|
|
else if(StrEqual(diff, "impossible", false)) return 3;
|
|
else return 1;
|
|
}
|
|
|
|
stock int GetSurvivorCount() {
|
|
int count;
|
|
for(int i = 1; i <= MaxClients; i++) {
|
|
if(IsClientInGame(i) && GetClientTeam(i) == 2) {
|
|
count++;
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
|
|
// get the distance between two entities
|
|
float GetEntityDistance(int entityA, int entityB, bool squared = false) {
|
|
float pos1[3], pos2[3];
|
|
GetEntPropVector(entityA, Prop_Send, "m_vecOrigin", pos1);
|
|
GetEntPropVector(entityB, Prop_Send, "m_vecOrigin", pos2);
|
|
return GetVectorDistance(pos1, pos2, squared);
|
|
} |