mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-08 07:43:20 +00:00
Update .inc
This commit is contained in:
parent
369cf089d4
commit
3daf334f30
2 changed files with 67 additions and 11 deletions
|
@ -94,8 +94,10 @@ enum L4D2Infected
|
||||||
L4D2Infected_Witch = 7,
|
L4D2Infected_Witch = 7,
|
||||||
L4D2Infected_Tank = 8
|
L4D2Infected_Tank = 8
|
||||||
};
|
};
|
||||||
int g_iTrollUsers[MAXPLAYERS+1], g_iAttackerTarget[MAXPLAYERS+1], autoPunished = -1, autoPunishMode, lastButtonUser, lastCrescendoUser;
|
int g_iTrollUsers[MAXPLAYERS+1], g_iAttackerTarget[MAXPLAYERS+1];
|
||||||
bool g_bPendingItemGive[MAXPLAYERS+1];
|
int autoPunished = -1, autoPunishMode, lastButtonUser, lastCrescendoUser;
|
||||||
|
bool g_bPendingItemGive[MAXPLAYERS+1], g_PendingBanTroll[MAXPLAYERS+1];
|
||||||
|
GlobalForward g_PlayerMarkedForward;
|
||||||
|
|
||||||
|
|
||||||
//Applies the selected trollMode to the victim.
|
//Applies the selected trollMode to the victim.
|
||||||
|
@ -149,9 +151,6 @@ void ApplyModeToClient(int client, int victim, trollMode mode, TrollModifier mod
|
||||||
TurnOffTrollMode(victim, Troll_PrimaryDisable);
|
TurnOffTrollMode(victim, Troll_PrimaryDisable);
|
||||||
SDKHook(victim, SDKHook_WeaponCanUse, Event_ItemPickup);
|
SDKHook(victim, SDKHook_WeaponCanUse, Event_ItemPickup);
|
||||||
}
|
}
|
||||||
case Troll_DamageBoost: {
|
|
||||||
SDKHook(victim, SDKHook_OnTakeDamage, Event_TakeDamage);
|
|
||||||
}
|
|
||||||
case Troll_Clumsy: {
|
case Troll_Clumsy: {
|
||||||
//TODO: Implement modifier code
|
//TODO: Implement modifier code
|
||||||
int wpn = GetClientSecondaryWeapon(victim);
|
int wpn = GetClientSecondaryWeapon(victim);
|
||||||
|
@ -222,7 +221,10 @@ void ApplyModeToClient(int client, int victim, trollMode mode, TrollModifier mod
|
||||||
if(HasTrollMode(victim, mode)) {
|
if(HasTrollMode(victim, mode)) {
|
||||||
ShowActivity(client, "deactivated troll \"%s\" on %N. ", TROLL_MODES_NAMES[mode], victim);
|
ShowActivity(client, "deactivated troll \"%s\" on %N. ", TROLL_MODES_NAMES[mode], victim);
|
||||||
}else{
|
}else{
|
||||||
ShowActivity(client, "activated troll \"%s\" on %N. ", TROLL_MODES_NAMES[mode], victim);
|
if(modifier == TrollMod_Repeat)
|
||||||
|
ShowActivity(client, "activated troll \"%s\" on repeat for %N. ", TROLL_MODES_NAMES[mode], victim);
|
||||||
|
else
|
||||||
|
ShowActivity(client, "activated troll \"%s\" for %N. ", TROLL_MODES_NAMES[mode], victim);
|
||||||
}
|
}
|
||||||
//If instant fire mod not provided (aka instead of no modifiers which equals both) OR repeat turned on, set bit:
|
//If instant fire mod not provided (aka instead of no modifiers which equals both) OR repeat turned on, set bit:
|
||||||
if(modifier == TrollMod_Repeat || modifier == TrollMod_None) {
|
if(modifier == TrollMod_Repeat || modifier == TrollMod_None) {
|
||||||
|
@ -252,7 +254,6 @@ void ResetClient(int victim, bool wipe = true) {
|
||||||
int wpn = GetClientWeaponEntIndex(victim, 0);
|
int wpn = GetClientWeaponEntIndex(victim, 0);
|
||||||
if(wpn > -1)
|
if(wpn > -1)
|
||||||
SDKUnhook(wpn, SDKHook_Reload, Event_WeaponReload);
|
SDKUnhook(wpn, SDKHook_Reload, Event_WeaponReload);
|
||||||
SDKUnhook(victim, SDKHook_OnTakeDamage, Event_TakeDamage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActivateAutoPunish(int client) {
|
void ActivateAutoPunish(int client) {
|
||||||
|
@ -269,3 +270,26 @@ void ActivateAutoPunish(int client) {
|
||||||
CreateTimer(60.0 * hAutoPunishExpire.FloatValue, Timer_ResetAutoPunish, GetClientOfUserId(lastButtonUser));
|
CreateTimer(60.0 * hAutoPunishExpire.FloatValue, Timer_ResetAutoPunish, GetClientOfUserId(lastButtonUser));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ToggleMarkPlayer(int client, int target) {
|
||||||
|
if(g_PendingBanTroll[target]) {
|
||||||
|
g_PendingBanTroll[target] = false;
|
||||||
|
ShowActivity(client, "unmarked %N as troll", target);
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
AdminId admin_client = GetUserAdmin(client);
|
||||||
|
AdminId admin_target = GetUserAdmin(target);
|
||||||
|
if(admin_client != INVALID_ADMIN_ID && admin_target == INVALID_ADMIN_ID ) {
|
||||||
|
Call_StartForward(g_PlayerMarkedForward);
|
||||||
|
Call_PushCell(client);
|
||||||
|
Call_PushCell(target);
|
||||||
|
Call_Finish();
|
||||||
|
g_PendingBanTroll[target] = true;
|
||||||
|
ShowActivity(client, "marked %N as troll", target);
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
ReplyToCommand(client, "cannot mark %N as troll as they are an admin.", target);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -66,7 +66,39 @@ stock void ShowDelayedHintToAll(const char[] format, any ...) {
|
||||||
}
|
}
|
||||||
hintInt++;
|
hintInt++;
|
||||||
}
|
}
|
||||||
stock int GetSurvivorId(const char str[16]) {
|
|
||||||
|
stock int GetSurvivorId(const char str[16], bool isL4D1 = false) {
|
||||||
|
int possibleNumber = StringToInt(str, 10);
|
||||||
|
if(strlen(str) == 1) {
|
||||||
|
if(possibleNumber <= 7 && possibleNumber >= 0) {
|
||||||
|
return possibleNumber;
|
||||||
|
}
|
||||||
|
}else if(possibleNumber == 0) {
|
||||||
|
/*
|
||||||
|
L4D2:
|
||||||
|
0 - Nick, 4 - Bill, 5 - Zoey, 6 - Francis, 7 - Louis
|
||||||
|
L4D1:
|
||||||
|
0 - Bill, 1 - Zoey, 2 - Louis, 3 - Francis
|
||||||
|
*/
|
||||||
|
if(StrEqual(str, "nick", false)) return 0;
|
||||||
|
else if(StrEqual(str, "rochelle", false)) return 1;
|
||||||
|
else if(StrEqual(str, "coach", false)) return 2;
|
||||||
|
else if(StrEqual(str, "ellis", false)) return 3;
|
||||||
|
if(isL4D1) {
|
||||||
|
if(StrEqual(str, "bill", false)) return 0;
|
||||||
|
else if(StrEqual(str, "zoey", false)) return 1;
|
||||||
|
else if(StrEqual(str, "francis", false)) return 3;
|
||||||
|
else if(StrEqual(str, "louis", false)) return 2;
|
||||||
|
}else{
|
||||||
|
if(StrEqual(str, "bill", false)) return 4;
|
||||||
|
else if(StrEqual(str, "zoey", false)) return 5;
|
||||||
|
else if(StrEqual(str, "francis", false)) return 6;
|
||||||
|
else if(StrEqual(str, "louis", false)) return 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
stock int GetL4D2SurvivorId(const char str[16]) {
|
||||||
int possibleNumber = StringToInt(str, 10);
|
int possibleNumber = StringToInt(str, 10);
|
||||||
if(strlen(str) == 1) {
|
if(strlen(str) == 1) {
|
||||||
if(possibleNumber <= 7 && possibleNumber >= 0) {
|
if(possibleNumber <= 7 && possibleNumber >= 0) {
|
||||||
|
@ -77,10 +109,10 @@ stock int GetSurvivorId(const char str[16]) {
|
||||||
else if(StrEqual(str, "rochelle", false)) return 1;
|
else if(StrEqual(str, "rochelle", false)) return 1;
|
||||||
else if(StrEqual(str, "coach", false)) return 2;
|
else if(StrEqual(str, "coach", false)) return 2;
|
||||||
else if(StrEqual(str, "ellis", false)) return 3;
|
else if(StrEqual(str, "ellis", false)) return 3;
|
||||||
else if(StrEqual(str, "bill", false)) return 4;
|
else if(StrEqual(str, "bill", false)) return 0;
|
||||||
else if(StrEqual(str, "zoey", false)) return 5;
|
else if(StrEqual(str, "zoey", false)) return 5;
|
||||||
else if(StrEqual(str, "francis", false)) return 6;
|
else if(StrEqual(str, "francis", false)) return 3;
|
||||||
else if(StrEqual(str, "louis", false)) return 7;
|
else if(StrEqual(str, "louis", false)) return 2;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue