Raised This Month: $51 Target: $400
 12% 

L4D2 - I have a problem with this plugin help :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamer_kanelita
Senior Member
Join Date: Jun 2019
Location: Peru
Old 09-18-2020 , 17:18   L4D2 - I have a problem with this plugin help :(
Reply With Quote #1

I have a problem that until now I have not been able to repair it, this plugin is from Super HP, when I use it in my admin menu, I have it, I write it like this in my adminmenu_custom in the Configs folder:

"A * Super God HP"
{
"God HP"
{
"cmd" "sm_hp # 1 # 2"
"execute" "player"
"one"
{
"type" "groupplayer"
"method" "name"
"title" "Player:"

}
"two"
{
"type" "list"
"title" "Super HP"
"1" "100"
"one." "Normal HP"
"2" "25000"
"two." "Tank HP"
"3" "65099"
"3." "God HP"

}
}
}

Well, it works great for me, I use it in the finals mostly, now the only problem I have is that when I use 65099 HP and then use adrenaline, my Super HP goes down to 100 HP, on the game screen it does not change in the UHD but when at least 100 HP hurt me, it automatically disables me without taking effect, the 65099 HP I had, I don't know what the problem will be, here is a sample video of the problem, watch it so that you understand much better:

https://www.youtube.com/watch?v=1YFD...amerKanelaNene

I would like someone to correct this adrenaline problem, since I am ignorant in creating plugins and codes, but I have played this game for years with a modified server, I will leave the PHP CODE which is the plugin I use:



enum {
show,
set,
add
};

enum {
mode,
hp
};

public void OnPluginStart()
{
LoadTranslations("common.phrases.txt");

RegAdminCmd("sm_hp", sm_hp, ADMFLAG_SLAY, "Change player health points");
}


public Action sm_hp(int client, int args)
{
if(client != 0 && !IsClientInGame(client)) return Plugin_Continue;

if(args < 1)
{
ReplyToCommand(client, "[SM] Usage: sm_hp <name|#userid|@all> <hp|+hp|-hp>\n Set or change players health points.");

return Plugin_Handled;
}

char buffer[255];
int change_hp[2]; // {mode, hp}


change_hp[mode] = show;

if( args >= 2 && GetCmdArg(2, buffer, sizeof(buffer)) > 0 )
{
int index = FindCharInString(buffer, '+');

if( index != -1 || (index = FindCharInString(buffer, '-')) != -1 )
{
change_hp[mode] = add;
}
else
{
change_hp[mode] = set;
index = 0;
}

change_hp[hp] = StringToInt(buffer[index]);

if(change_hp[mode] == set && change_hp[hp] <= 0)
{
ReplyToCommand(client, "[SM] Give bigger HP number than zero. (%s)", buffer);
return Plugin_Handled;
}


//PrintToServer("buffer[%i] hp %i mode %i", index, change_hp[hp], change_hp[mode]);
}



bool tn_is_ml;
GetCmdArg(1, buffer, sizeof(buffer));
int number;
int[] targets = new int[MaxClients];


if( (number = ProcessTargetString(buffer, client,
targets, MaxClients,
COMMAND_FILTER_ALIVE,
buffer, sizeof(buffer),
tn_is_ml)) > COMMAND_TARGET_NONE )
{

ReplySource replysrc = GetCmdReplySource();
int clienthealth;

switch(change_hp[mode])
{
case show:
{
for(int x = 0; x < number; x++)
{
clienthealth = GetClientHealth(targets[x]);

if(client != 0 && replysrc == SM_REPLY_TO_CHAT)
{
if(number < 3)
{
if(x == 0)
{
tn_is_ml ? ReplyToCommand(client, "[SM] %t health:", buffer):ReplyToCommand(client, "[SM] %s health:", buffer);
}

ReplyToCommand(client, "%N hp %i", targets[x], clienthealth);
}
else if(x == 0)
{
ReplyToCommand(client, "[SM] Too many targets to show in chat, see console output message");
}
}
PrintToConsole(client, "- %N hp %i", targets[x], clienthealth);
}
}
case set:
{
//tn_is_ml ? ReplyToCommand(client, "[SM] You have set %t health to %i", buffer, change_hp[hp]):ReplyToCommand(client, "[SM] You have set %s health to %i", buffer, change_hp[hp]);
tn_is_ml ? ShowActivity2(client,"[SM] ", "have set %t health to %i", buffer, change_hp[hp]):ShowActivity2(client, "[SM] ", "have set %s health to %i", buffer, change_hp[hp]);

for(int x = 0; x < number; x++) SetEntityHealth(targets[x], change_hp[hp]);
}
case add:
{
if(change_hp[hp] > 0)
{
//tn_is_ml ? ReplyToCommand(client, "[SM] You have changed %t health by +%i", buffer, change_hp[hp]):ReplyToCommand(client, "[SM] You have changed %s health by +%i", buffer, change_hp[hp]);
tn_is_ml ? ShowActivity2(client, "[SM] ", "have changed %t health by +%i", buffer, change_hp[hp]):ShowActivity2(client, "[SM] ", "have changed %s health by +%i", buffer, change_hp[hp]);
}
else
{
//tn_is_ml ? ReplyToCommand(client, "[SM] You have changed %t health by -%i", buffer, change_hp[hp]):ReplyToCommand(client, "[SM] You have changed %s health by -%i", buffer, change_hp[hp]);
tn_is_ml ? ShowActivity2(client, "[SM] ", "have changed %t health by -%i", buffer, change_hp[hp]):ShowActivity2(client, "[SM] ", "have changed %s health by -%i", buffer, change_hp[hp]);
}

for(int x = 0; x < number; x++) SetEntityHealth(targets[x], GetClientHealth(targets[x]) + change_hp[hp]);
}
}


}
else // error
{
ReplyToTargetError(client, number);
return Plugin_Handled;
}

return Plugin_Handled;
}

Help me with this problem, I would appreciate it with all my heart
gamer_kanelita is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-18-2020 , 17:28   Re: L4D2 - I have a problem with this plugin help :(
Reply With Quote #2

Please, could you use code tags. It's horrible to read.

There is option Go Advanced in forum post.

Code:
and here my code
You see
      "Nice"
      {
      }
__________________
Do not Private Message @me
Bacardi is offline
gamer_kanelita
Senior Member
Join Date: Jun 2019
Location: Peru
Old 09-18-2020 , 22:27   Re: L4D2 - I have a problem with this plugin help :(
Reply With Quote #3

This plugin you created it, but if you see the sample video that I put the problem when I use adrenaline.

// Set HP = 100
sm_hp @all 100

// Increase HP +30
sm_hp Bacardi +30

// Decrease HP -50
sm_hp #userid -50
gamer_kanelita is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 09-20-2020 , 12:26   Re: L4D2 - I have a problem with this plugin help :(
Reply With Quote #4

Edit/paste the code again within [PHP] tags, no ones going to help when its an unformatted block of text like that.
__________________
Silvers is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode