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

Solved fly plugin help


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
vres
Junior Member
Join Date: Dec 2023
Location: Turkey
Old 01-06-2024 , 11:24   fly plugin help
#1

Can you edit this code? It should function like a hook plugin, for example, with a command like bind c +fly

And if it's not too much trouble for you, could you also add amx_givefly and amx_takefly features? The fly ability given to the player should be permanent and should not be removed when they leave the server.

thank you

Code:
public client_PreThink(id)  
{ 

    if( is_user_alive(id) ) 
    { 
        new Float:fAim[3]
        VelocityByAim(id , 500, fAim)
        
        if( !(get_user_button(id) & IN_JUMP) ) 
            set_user_velocity(id, fAim)
    } 
    return PLUGIN_CONTINUE
}

Last edited by DarkDeviL; 01-08-2024 at 19:07. Reason: Restore to previous version.
vres is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 01-06-2024 , 14:05   Re: fly plugin help
#2

Buddy, no one will help you if you don't properly leave the entire code, not just a part of it, I believe you are not the author of that code, if you were, you would know how to solve it. Once again, post the entire code.
Uzviseni Bog is offline
vres
Junior Member
Join Date: Dec 2023
Location: Turkey
Old 01-06-2024 , 15:31   Re: fly plugin help
#3

Quote:
Originally Posted by Uzviseni Bog View Post
Buddy, no one will help you if you don't properly leave the entire code, not just a part of it, I believe you are not the author of that code, if you were, you would know how to solve it. Once again, post the entire code.
this is everything

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>

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


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

public client_PreThink(id)  
{ 

    if( is_user_alive(id) ) 
    { 
        new Float:fAim[3]
        VelocityByAim(id , 500, fAim)
        
        if( !(get_user_button(id) & IN_JUMP) ) 
            set_user_velocity(id, fAim)
    } 
    return PLUGIN_CONTINUE
}
It already works like this

Last edited by DarkDeviL; 01-08-2024 at 19:08. Reason: Restore to previous version.
vres is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 01-06-2024 , 15:43   Re: fly plugin help
#4

Quote:
Originally Posted by vres View Post
this is everything

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>

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


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

public client_PreThink(id)  
{ 

    if( is_user_alive(id) ) 
    { 
        new Float:fAim[3]
        VelocityByAim(id , 500, fAim)
        
        if( !(get_user_button(id) & IN_JUMP) ) 
            set_user_velocity(id, fAim)
    } 
    return PLUGIN_CONTINUE
}
It already works like this


What do you actually want? Do you want a hook that will be bound with the command 'bind c +fly' instead of 'bind c +hook', and to be given to certain players through a command?
Uzviseni Bog is offline
vres
Junior Member
Join Date: Dec 2023
Location: Turkey
Old 01-06-2024 , 16:11   Re: fly plugin help
#5

Quote:
Originally Posted by Uzviseni Bog View Post
What do you actually want? Do you want a hook that will be bound with the command 'bind c +fly' instead of 'bind c +hook', and to be given to certain players through a command?
If you've tried this code, you can see that the player can fly. I want it to work like a hook plugin, meaning it should activate with a command like +fly when the 'c' key is pressed, and the code should stop running when the 'c' key is released. In essence, I want it to function as a hook plugin with +fly and -fly commands.

Additionally, I want to be able to give and take this flying ability permanently to/from a player using the amx_givefly and amx_takefly commands. Even if the player logs out and logs back in, they should still have this ability, as it is stored as a permanent feature for that specific player.

sample hook plugin

https://forums.alliedmods.net/showthread.php?t=52304

Last edited by DarkDeviL; 01-08-2024 at 19:08. Reason: Restore to previous version.
vres is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-06-2024 , 19:13   Re: fly plugin help
#6

If you want it to work like that plugin, you simply need to look at how that plugin does what you want it to do. This is the Scripting Help forum meaning that you are the one writing the plugin. You have all you need in the Hook plugin to implement the +command feature that you're asking for.

Try using the hook plugin as a basis and create your own plugin for your feature. If you run into a specific issue, post your latest version of the code with a specific question. It should be quite simple actually. If your code above works as you want functionally, simply replace the button check with a boolean check that gets set by the +/- commands.

Regarding the "permanent access", that's a whole different thing. You can find other plugins that save things like this (e.g. using nVault). So, after you get the main plugin functions working, start working on this part and post a new thread if you have specific issues.
__________________

Last edited by fysiks; 01-06-2024 at 19:14.
fysiks is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-07-2024 , 16:26   Re: fly plugin help
#7

This request already exist instead its phrased as "jetpack" its an item you can use to fly.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
vres
Junior Member
Join Date: Dec 2023
Location: Turkey
Old 01-07-2024 , 20:06   Re: SOLVED plugin help
#8

I finally managed to do it and it works very well, thank you for your answers.
vres is offline
Closed Thread



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 01:21.


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