Raised This Month: $32 Target: $400
 8% 

Just Capture the Flag (CTF) v1.32c (26 jun 2012)


Post New Thread Reply   
 
Thread Tools Display Modes
beginnercs
Junior Member
Join Date: Jul 2020
Old 10-05-2020 , 12:58   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #631

hi guys, first of all sorry for the bad english, i'm using google translator.
I would like your help in something that I'm trying to do.
I want to add one more option in the combo of options for using adrenaline, the 4 possible combos are speed, berserk, regenerate and invisibility; and I want to add one more, I was able to edit the original sma and add one more option, it appears in the menu and the adrenaline is used when selecting the option, but I was unable to make the function of that option work. I attached the sma that I edited here, for you to see what I edited.

the function I want in this option is that when a player kills another using the knife, the frags of the one who died are reset.
I have a plugin that does this, its code is this:

Code:
#include < amxmodx >
#include < cstrike >
#include < fun >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_event( "DeathMsg", "e_DeathMsg", "a" );
}

public e_DeathMsg( id )
{
	new Attacker	= read_data( 1 );
	new iVictim	= read_data( 2 );

	new WeaponID = get_user_weapon( Attacker );

	new szName[ 2 ][ 33 ];

	get_user_name( iVictim, szName[ 0 ], 32 );
	get_user_name( Attacker, szName[ 1 ], 32 );

	if( iVictim )
	{
		if( WeaponID == CSW_KNIFE )
		{
			set_user_frags( iVictim, 0 );
			cs_set_user_deaths( iVictim, -1 );
	
			new i = get_user_frags( Attacker );
			set_user_frags( Attacker, i+1 );
			
			set_hudmessage(0, 255, 0, 0.02, 0.66, 2, 1.0, 7.0, 0.03, 0.2)
			show_hudmessage(0,"%s... Teve seu FRAG resetado^nPois morreu na faca por: %s...!", szName[ 0 ], szName[ 1 ]);
	
		     
		}
	}
}

// Stock
stock ColorChat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!n", "^1")
	replace_all(msg, 190, "!t", "^3")
	replace_all(msg, 190, "!t2", "^0")
	
	if (id) players[0] = id; else get_players(players, count, "ch")

	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i])
			write_string(msg)
			message_end()
		}
	}
}
and it works perfectly, but I just wanted to be able to reset the frags of another player using adrenaline, so I added the code for this plugin in the jctf sma, but I couldn't make it work
I understand that the "DeathMsg" event is necessary to work, but I came across a problem
if I record the event, as seen in line 1270 of the sma that I attached, the coding works but all players can use the knife freely to reset the frags of another player without the use of adrenaline,
but if I don't register the event the code doesn't work

on line 3651 of the sma that I attached you can see the code that I added.
Code:
case KNIFE_RESET:
		{
			new Attacker = read_data( 1 );
			new iVictim = read_data( 2 );
			new WeaponID = get_user_weapon( Attacker );
			new szName[ 2 ][ 33 ];
			get_user_name( iVictim, szName[ 0 ], 32 );
			get_user_name( Attacker, szName[ 1 ], 32 );
			if( iVictim )
			{
				if( WeaponID == CSW_KNIFE )
				{
					set_user_frags( iVictim, 0 );
					cs_set_user_deaths( iVictim, -1 );
					new i = get_user_frags( Attacker );
					set_user_frags( Attacker, i+1 );
					set_hudmessage(0, 255, 0, 0.02, 0.66, 2, 1.0, 7.0, 0.03, 0.2)
					show_hudmessage(0,"%s... His FRAG was reset^nbecause he died under the knife for: %s...!", szName[ 0 ], szName[ 1 ]);
				}
			}
			
		}
in short, I want exactly this function to reset the frags of a birthday by killing him using the knife, but only with the use of adrenaline.

can anybody help me? I understand almost nothing about programming and can only edit parts of the code.
Attached Files
File Type: sma Get Plugin or Get Source (jctf.sma - 277 views - 143.1 KB)
File Type: txt jctf.txt (66.5 KB, 152 views)
beginnercs is offline
Axwell
New Member
Join Date: Nov 2020
Old 11-02-2020 , 11:11   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #632

Quote:
on line 3651 of the sma that I attached you can see the code that I added.:
Эта строчка должна быть в другом месте.
Посмотрите в сторону строки 2762, именно в той функции назначается результат от смерти.
Используйте условие использования адреналина у убийцы

Google translate to english:
This line should be in a different place.
Look towards line 2762, it is in that function that the result from death is assigned.
Use the killer adrenaline condition
Axwell is offline
cahervar
Member
Join Date: Mar 2021
Old 08-16-2021 , 21:27   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #633

Flag taken audio stops playing. does anyone know how to correct this?
cahervar is offline
cahervar
Member
Join Date: Mar 2021
Old 08-16-2021 , 21:32   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #634

jctf.sma::player_spawnEquipament (line 2517)
solution??
cahervar is offline
yagami
Senior Member
Join Date: Jan 2021
Old 07-31-2023 , 14:04   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #635

Can someone help me put infinite ammo?
yagami is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 08-20-2023 , 13:28   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #636

Quote:
Originally Posted by yagami View Post
Can someone help me put infinite ammo?
https://github.com/s1lentq/ReGameDLL...md?plain=1#L53
__________________
mlibre is offline
kurtbass
Junior Member
Join Date: Nov 2023
Old 11-17-2023 , 15:38   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #637

still works with regamedll?
kurtbass is offline
Old 11-17-2023, 17:55
Noochs
This message has been deleted by Noochs. Reason: Wrong Info
Noochs
Junior Member
Join Date: Apr 2020
Old 11-17-2023 , 23:55   Re: Just Capture the Flag (CTF) v1.32c (26 jun 2012)
Reply With Quote #638

Quote:
Originally Posted by kurtbass View Post
still works with regamedll?
I cant get it to work maybe someone can give us a little help
Noochs is offline
Reply


Thread Tools
Display Modes

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 19:41.


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