mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 02:53:21 +00:00
Update stuff
This commit is contained in:
parent
8fa970da0d
commit
3b4efecb8e
6 changed files with 58 additions and 7 deletions
Binary file not shown.
Binary file not shown.
|
@ -176,7 +176,7 @@ ArrayList GetPhrasesArray(const char[] key) {
|
||||||
|
|
||||||
stock int FindClosestClientAdminPriority(int source, float pos[3]) {
|
stock int FindClosestClientAdminPriority(int source, float pos[3]) {
|
||||||
int c = FindClosestAdmin(source, pos);
|
int c = FindClosestAdmin(source, pos);
|
||||||
if(c == -1) return FindClosestClient(source, ignoreBots, pos);
|
if(c == -1) return FindClosestClient(source, true,pos);
|
||||||
else return c;
|
else return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -527,7 +527,7 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
||||||
while(numFlags > 0) {
|
while(numFlags > 0) {
|
||||||
// Apply a random flag
|
// Apply a random flag
|
||||||
rndFlags |= GetRandomInt(0, maxFlags)
|
rndFlags |= GetRandomInt(0, maxFlags)
|
||||||
maxFlags--;
|
numFlags--;
|
||||||
}
|
}
|
||||||
trollModifier rndMod = Trolls[rndTroll].GetDefaultMod();
|
trollModifier rndMod = Trolls[rndTroll].GetDefaultMod();
|
||||||
if(Trolls[rndTroll].HasMod(TrollMod_Constant) && GetURandomFloat() > 0.5) {
|
if(Trolls[rndTroll].HasMod(TrollMod_Constant) && GetURandomFloat() > 0.5) {
|
||||||
|
|
|
@ -125,6 +125,9 @@ Action Command_DoAHat(int client, int args) {
|
||||||
ReplyToCommand(client, "Flags: %d", hatData[client].flags);
|
ReplyToCommand(client, "Flags: %d", hatData[client].flags);
|
||||||
// ReplyToCommand(client, "CurOffset: %f %f %f", );
|
// ReplyToCommand(client, "CurOffset: %f %f %f", );
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
|
} else if(arg[0] == 'a') {
|
||||||
|
ShowAttachPointMenu(client);
|
||||||
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
// int orgEntity = entity;
|
// int orgEntity = entity;
|
||||||
if(HasFlag(client, HAT_REVERSED)) {
|
if(HasFlag(client, HAT_REVERSED)) {
|
||||||
|
@ -455,13 +458,63 @@ Action Command_DoAHat(int client, int args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define MAX_ATTACHMENT_POINTS 20
|
||||||
|
char ATTACHMENT_POINTS[MAX_ATTACHMENT_POINTS][] = {
|
||||||
|
"eyes",
|
||||||
|
"molotov",
|
||||||
|
"pills",
|
||||||
|
"grenade",
|
||||||
|
"primary",
|
||||||
|
"medkit",
|
||||||
|
"melee",
|
||||||
|
"survivor_light",
|
||||||
|
"bleedout",
|
||||||
|
"forward",
|
||||||
|
"survivor_neck",
|
||||||
|
"muzzle_flash",
|
||||||
|
"spine",
|
||||||
|
"legL",
|
||||||
|
"legR",
|
||||||
|
"thighL",
|
||||||
|
"thighR",
|
||||||
|
"lfoot",
|
||||||
|
"rfoot",
|
||||||
|
"mouth",
|
||||||
|
};
|
||||||
|
|
||||||
|
void ShowAttachPointMenu(int client) {
|
||||||
|
Menu menu = new Menu(AttachPointHandler);
|
||||||
|
menu.SetTitle("Choose an attach point");
|
||||||
|
for(int i = 0; i < MAX_ATTACHMENT_POINTS; i++) {
|
||||||
|
menu.AddItem(ATTACHMENT_POINTS[i], ATTACHMENT_POINTS[i]);
|
||||||
|
}
|
||||||
|
menu.Display(client, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int AttachPointHandler(Menu menu, MenuAction action, int client, int param2) {
|
||||||
|
if (action == MenuAction_Select) {
|
||||||
|
char attachPoint[32];
|
||||||
|
menu.GetItem(param2, attachPoint, sizeof(attachPoint));
|
||||||
|
if(!HasHat(client)) {
|
||||||
|
ReplyToCommand(client, "No hat is equipped");
|
||||||
|
} else {
|
||||||
|
int hat = GetHat(client);
|
||||||
|
char classname[32];
|
||||||
|
GetEntityClassname(hat, classname, sizeof(classname));
|
||||||
|
EquipHat(client, hat, classname, hatData[client].flags, attachPoint);
|
||||||
|
CReplyToCommand(client, "Attachment point set to {olive}%s", attachPoint);
|
||||||
|
}
|
||||||
|
} else if (action == MenuAction_End)
|
||||||
|
delete menu;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Handles consent that a person to be hatted by another player
|
// Handles consent that a person to be hatted by another player
|
||||||
public int HatConsentHandler(Menu menu, MenuAction action, int target, int param2) {
|
int HatConsentHandler(Menu menu, MenuAction action, int target, int param2) {
|
||||||
if (action == MenuAction_Select) {
|
if (action == MenuAction_Select) {
|
||||||
static char info[8];
|
char info[8];
|
||||||
menu.GetItem(param2, info, sizeof(info));
|
menu.GetItem(param2, info, sizeof(info));
|
||||||
static char str[2][8];
|
char str[2][8];
|
||||||
ExplodeString(info, "|", str, 2, 8, false);
|
ExplodeString(info, "|", str, 2, 8, false);
|
||||||
int activator = GetClientOfUserId(StringToInt(str[0]));
|
int activator = GetClientOfUserId(StringToInt(str[0]));
|
||||||
int hatAction = StringToInt(str[1]);
|
int hatAction = StringToInt(str[1]);
|
||||||
|
|
|
@ -369,8 +369,6 @@ public void OnPluginStart() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Action Timer_Director(Handle h) {
|
Action Timer_Director(Handle h) {
|
||||||
if(abmExtraCount <= 4) return Plugin_Continue;
|
if(abmExtraCount <= 4) return Plugin_Continue;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue