Raised This Month: $ Target: $400
 0% 

Speed Boosts - Surf Tool - v0.0.2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-01-2024 , 05:07   Speed Boosts - Surf Tool - v0.0.2
Reply With Quote #1

Speed Boosts
v0.0.2 released at : 11/06/2024

Bring fun back to the Surf servers with this Speed Boost creator!



Configuration File (surf_ski_2.ini example)
Code:
; Origin - Speed Multiplier
614.073730 659.897644 116.305969 3
614.073730 1053.377685 116.305969 3
-2361.141601 -1175.511840 -361.788970 2


Each map requires a different configuration file as Origins per map will not be the same.

Gameplay Video
Menu Usage Video

If you were using v0.0.1 you must re-download cstrike.zip as it has a new sprite.

You can open the manager menu with the command sb_menu. In order to access this menu you must use sb_toggle on console first. Only 1 admin can access the menu at a time.
Attached Files
File Type: zip cstrike.zip (80.7 KB, 4 views)
File Type: sma Get Plugin or Get Source (speed_boosts.sma - 4 views - 13.0 KB)
__________________

Last edited by Jhob94; 06-11-2024 at 15:30. Reason: added v0.0.2
Jhob94 is offline
Old 06-01-2024, 05:08
Jhob94
This message has been deleted by Jhob94. Reason: Useless after v0.0.2
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-01-2024 , 08:55   Re: Speed Boosts (Surf Tool)
Reply With Quote #2

Why bother print_origin when spec_pos works fine? Trigger_push might be worth your time experimenting with.

The way it was written non-admins can exploit the noclip. Also shows as Unknown command.
Unknown command: print_origin
Unknown command: give_noclip] print_origin

Code:
#include <amxmodx> #include <fakemeta> #include <fun> public plugin_init() {     register_plugin("test-only plugin", "0.0.2", "Author")     register_clcmd("give_noclip", "Cmd__Noclip", ADMIN_RCON, "NOCLIP", 1) } public Cmd__Noclip(id) {     if(is_user_connected(id))     {         set_user_noclip(id, !get_user_noclip(id))         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }

There is some sort of bug with printing to console. It can overflow. Print_chat is safer. Looking at Amxx with the new C standards it won't compile finding memory leaks by the hundreds, this comes as no surprise. Be sure to check if user is connected on the main plugin also please before issuing commands or doing anything with client especially with a touch.
__________________
DJEarthQuake is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-01-2024 , 09:50   Re: Speed Boosts (Surf Tool)
Reply With Quote #3

The code for origin is just a quick plugin that i used on surf_ski_2. It is not included directly into the plugin as i don’t consider it necessary, i just posted it to help peopleand i clearly said it’s a test plugin.
I don’t need to check if user is connected because i check if user is alive which already checks if the user is connected on the is_user_alive() function.
The only release here is the plugin attached to the thread, how you get the origins is up to you.
__________________
Jhob94 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-02-2024 , 18:50   Re: Speed Boosts (Surf Tool)
Reply With Quote #4

Just because one called it test plugin doesn't mean it is justifiable to be complacent. Would you rather rise or lower your standards?

Code:
void CPlayer:: Disconnect()
{
	ingame = false;
When in timeout disco is undetected and bool ingame has not caught up yet. Touch can send 1000x per second to a player in time-out. It's just a safeguard when going from one function to the next. Any function that is doing anything with a client add a check.

Look over HL code. It is impossible to find a function without checking if they are connected.
Float seems more precise. On Hammer nothing is float.
There is a variance on pev and spec_pos with height. Like when one shows 40.0 the other shows 60. That's quite a gap!
__________________
DJEarthQuake is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-03-2024 , 05:05   Re: Speed Boosts (Surf Tool)
Reply With Quote #5

Code:
 static cell AMX_NATIVE_CALL is_user_connected(AMX *amx, cell *params) /* 1 param */
{
	int index = params[1];

	if (index < 1 || index > gpGlobals->maxClients)
		return 0;

	CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);

	return (pPlayer->ingame ? 1 : 0);
}

Code:
 static cell AMX_NATIVE_CALL is_user_alive(AMX *amx, cell *params) /* 1 param */
{
	int index = params[1];

	if (index < 1 || index > gpGlobals->maxClients)
	{
		return FALSE;
	}

	CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);

	if (!pPlayer->ingame)
	{
		return FALSE;
	}

	if (g_bmod_tfc)
	{
		edict_t *e = pPlayer->pEdict;
		if (e->v.flags & FL_SPECTATOR ||
			(!e->v.team || !e->v.playerclass))
		{
			return FALSE;
		}
	}

	return pPlayer->IsAlive() ? TRUE : FALSE;
}
As you can see if is_user_alive() function includes itself if_is_user_connected() before checking if a player is alive. Plus the probability of an user disconnect while touching this entities is extremely low.

This isn’t scripting help, stop derailing with non-sense tips.
__________________
Jhob94 is offline
Old 06-03-2024, 22:57
WATCH_D0GS UNITED
This message has been deleted by WATCH_D0GS UNITED. Reason: already.
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-04-2024 , 13:32   Re: Speed Boosts (Surf Tool)
Reply With Quote #6

Looks nice although i wouldn’t bother doing any type of sophisticated plugin for something that will be used temporary. But good job.

@DJ about spec_pos it is redundant. Getting origin gets your true origin while spec_pos gets your camera view origin, that’s why you get a gap. There is nothing wrong with pev.
__________________
Jhob94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-11-2024 , 15:29   Re: Speed Boosts (Surf Tool)
Reply With Quote #7

Update v0.0.2

Added a manager menu with the commands sb_toggle and sb_menu.
This new menu allows to create speed boost entities, delete, change XYZ locations and speed force. Also includes saving feature so you don't need to manually add them anymore.

Have fun
__________________

Last edited by Jhob94; 06-11-2024 at 15:31.
Jhob94 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 18:53.


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