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

Parachute 1.3 (KRoTaL)


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-11-2015 , 06:39   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #241

Nice, I'm glad I can help. ;)

Happy playing!
zmd94 is offline
Tonblader
Senior Member
Join Date: Jul 2011
Location: Peru
Old 06-11-2016 , 22:00   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #242

As I can do to make the parachutes, you can use only some users with certain access, in this case ADMIN_LEVEL_H

Tonblader is offline
PluginDownloader
New Member
Join Date: Jul 2017
Location: Serbia
Old 07-10-2017 , 15:39   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #243

Nice plugin i like it
__________________
PluginDownloader is offline
luciaus18
Senior Member
Join Date: Dec 2014
Old 09-27-2017 , 04:35   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #244

When I use parachute and I have gravity from another plugin that gravity dissapear. How can I fix it? Thank you
luciaus18 is offline
Old 11-19-2017, 15:07
ZEDD_Intensity
This message has been deleted by ZEDD_Intensity.
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 11-19-2017 , 15:33   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #245

Quote:
Originally Posted by ZEDD_Intensity View Post
Greetings,

It seems like anyone who connects to the server is able to use the Parachute even with ADMIN_LEVEL_A is defined.

Confirmed that my parachute_cost is set to "10000" and not "0".
I'd request some with Limiting the usage of the Parachute to ADMIN_LEVEL_B (Flag N)

Current Code with Changed Prices/Payouts
You mean this?

PHP Code:
#define PARACHUTE_LEVEL ADMIN_LEVEL_A 
>

PHP Code:
#define PARACHUTE_LEVEL ADMIN_LEVEL_B 
Alber9091 is offline
Old 11-19-2017, 15:35
ZEDD_Intensity
This message has been deleted by ZEDD_Intensity. Reason: debug solved it!
Old 11-21-2017, 07:35
ZEDD_Intensity
This message has been deleted by ZEDD_Intensity.
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-21-2017 , 16:19   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #246

Didnt test it but should work
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

new para_ent[33]
new 
pDetachpFallSpeedpEnabled

#define PARACHUTE_LEVEL ADMIN_LEVEL_B

public plugin_init()
{
    
register_plugin("Parachute""1.3""KRoT@L/JTP10181")
    
pEnabled register_cvar("sv_parachute""1" )
    
pFallSpeed register_cvar("parachute_fallspeed""90")
    
pDetach register_cvar("parachute_detach""1")
    
    
register_event("DeathMsg""death_event""a")
    
    
//Setup jtp10181 CVAR
    
new cvarString[256], shortName[16]
    
copy(shortName,15,"chute")
    
    
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
    
get_cvar_string("jtp10181",cvarString,255)
    
    if (
strlen(cvarString) == 0) {
        
formatex(cvarString,255,shortName)
        
set_cvar_string("jtp10181",cvarString)
    }
    else if (
contain(cvarString,shortName) == -1) {
        
format(cvarString,255,"%s,%s",cvarStringshortName)
        
set_cvar_string("jtp10181",cvarString)
    }
}

public 
plugin_natives()
{
    
set_module_filter("module_filter")
    
set_native_filter("native_filter")
}

public 
module_filter(const module[])
{
    if (!
cstrike_running() && equali(module"cstrike")) {
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}

public 
native_filter(const name[], indextrap)
{
    if (!
trap) return PLUGIN_HANDLED
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache()
{
    
precache_model("models/parachute.mdl")
}

public 
client_connect(id)
{
    
parachute_reset(id)
}

public 
client_disconnect(id)
{
    
parachute_reset(id)
}

public 
death_event()
{
    new 
id read_data(2)
    
parachute_reset(id)
}

parachute_reset(id)
{
    if(
para_ent[id] > 0) {
        if (
is_valid_ent(para_ent[id])) {
            
remove_entity(para_ent[id])
        }
    }
    
    if (
is_user_alive(id)) set_user_gravity(id1.0)
    
    
para_ent[id] = 0
}

public 
client_PreThink(id)
{
    
//parachute.mdl animation information
    //0 - deploy - 84 frames
    //1 - idle - 39 frames
    //2 - detach - 29 frames
    
    
if (!get_pcvar_num(pEnabled)) return
    if (!
is_user_alive(id) || !access(id,PARACHUTE_LEVEL)) return
    
    new 
Float:fallspeed get_pcvar_float(pFallSpeed) * -1.0
    
new Float:frame
    
    
new button get_user_button(id)
    new 
oldbutton get_user_oldbutton(id)
    new 
flags get_entity_flags(id)
    
    if (
para_ent[id] > && (flags FL_ONGROUND)) {
        
        if (
get_pcvar_num(pDetach)) {
            
            if (
get_user_gravity(id) == 0.1set_user_gravity(id1.0)
            
            if (
entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
                
entity_set_int(para_ent[id], EV_INT_sequence2)
                
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                
entity_set_float(para_ent[id], EV_FL_frame0.0)
                
entity_set_float(para_ent[id], EV_FL_fuser10.0)
                
entity_set_float(para_ent[id], EV_FL_animtime0.0)
                
entity_set_float(para_ent[id], EV_FL_framerate0.0)
                return
            }
            
            
frame entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
            entity_set_float
(para_ent[id],EV_FL_fuser1,frame)
            
entity_set_float(para_ent[id],EV_FL_frame,frame)
            
            if (
frame 254.0) {
                
remove_entity(para_ent[id])
                
para_ent[id] = 0
            
}
        }
        else {
            
remove_entity(para_ent[id])
            
set_user_gravity(id1.0)
            
para_ent[id] = 0
        
}
        
        return
    }
    
    if (
button IN_USE) {
        
        new 
Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
        if (
velocity[2] < 0.0) {
            
            if(
para_ent[id] <= 0) {
                
para_ent[id] = create_entity("info_target")
                if(
para_ent[id] > 0) {
                    
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
                    
entity_set_edict(para_ent[id], EV_ENT_aimentid)
                    
entity_set_edict(para_ent[id], EV_ENT_ownerid)
                    
entity_set_int(para_ent[id], EV_INT_movetypeMOVETYPE_FOLLOW)
                    
entity_set_model(para_ent[id], "models/parachute.mdl")
                    
entity_set_int(para_ent[id], EV_INT_sequence0)
                    
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                    
entity_set_float(para_ent[id], EV_FL_frame0.0)
                    
entity_set_float(para_ent[id], EV_FL_fuser10.0)
                }
            }
            
            if (
para_ent[id] > 0) {
                
                
entity_set_int(idEV_INT_sequence3)
                
entity_set_int(idEV_INT_gaitsequence1)
                
entity_set_float(idEV_FL_frame1.0)
                
entity_set_float(idEV_FL_framerate1.0)
                
set_user_gravity(id0.1)
                
                
velocity[2] = (velocity[2] + 40.0 fallspeed) ? velocity[2] + 40.0 fallspeed
                entity_set_vector
(idEV_VEC_velocityvelocity)
                
                if (
entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
                    
                    
frame entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
                    entity_set_float
(para_ent[id],EV_FL_fuser1,frame)
                    
entity_set_float(para_ent[id],EV_FL_frame,frame)
                    
                    if (
frame 100.0) {
                        
entity_set_float(para_ent[id], EV_FL_animtime0.0)
                        
entity_set_float(para_ent[id], EV_FL_framerate0.4)
                        
entity_set_int(para_ent[id], EV_INT_sequence1)
                        
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                        
entity_set_float(para_ent[id], EV_FL_frame0.0)
                        
entity_set_float(para_ent[id], EV_FL_fuser10.0)
                    }
                }
            }
        }
        else if (
para_ent[id] > 0) {
            
remove_entity(para_ent[id])
            
set_user_gravity(id1.0)
            
para_ent[id] = 0
        
}
    }
    else if ((
oldbutton IN_USE) && para_ent[id] > ) {
        
remove_entity(para_ent[id])
        
set_user_gravity(id1.0)
        
para_ent[id] = 0
    
}


Last edited by TheWhitesmith; 11-21-2017 at 16:20.
TheWhitesmith is offline
Old 11-22-2017, 00:37
ZEDD_Intensity
This message has been deleted by ZEDD_Intensity.
Old 11-22-2017, 07:15
ZEDD_Intensity
This message has been deleted by ZEDD_Intensity.
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-22-2017 , 10:23   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #247

I expect that your mod has some sort of Monsters/NPC Players (not real players, and they do not appear in scoreboard)
Anyway it is fixed, there you go:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

new para_ent[33]
new 
pDetachpFallSpeedpEnabled

#define PARACHUTE_LEVEL ADMIN_LEVEL_B

public plugin_init()
{
    
register_plugin("Parachute""1.3""KRoT@L/JTP10181")
    
pEnabled register_cvar("sv_parachute""1" )
    
pFallSpeed register_cvar("parachute_fallspeed""90")
    
pDetach register_cvar("parachute_detach""1")
    
    
register_event("DeathMsg""death_event""a")
    
    
//Setup jtp10181 CVAR
    
new cvarString[256], shortName[16]
    
copy(shortName,15,"chute")
    
    
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
    
get_cvar_string("jtp10181",cvarString,255)
    
    if (
strlen(cvarString) == 0) {
        
formatex(cvarString,255,shortName)
        
set_cvar_string("jtp10181",cvarString)
    }
    else if (
contain(cvarString,shortName) == -1) {
        
format(cvarString,255,"%s,%s",cvarStringshortName)
        
set_cvar_string("jtp10181",cvarString)
    }
}

public 
plugin_natives()
{
    
set_module_filter("module_filter")
    
set_native_filter("native_filter")
}

public 
module_filter(const module[])
{
    if (!
cstrike_running() && equali(module"cstrike")) {
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}

public 
native_filter(const name[], indextrap)
{
    if (!
trap) return PLUGIN_HANDLED
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache()
{
    
precache_model("models/parachute.mdl")
}

public 
client_putinserver(id)
{
    
parachute_reset(id)
}

public 
client_disconnect(id)
{
    
parachute_reset(id)
}

public 
death_event()
{
    new 
id read_data(2)
    if(
<= id <= 32)
    
parachute_reset(id)
}

parachute_reset(id)
{
    if(
para_ent[id] > 0) {
        if (
is_valid_ent(para_ent[id])) {
            
remove_entity(para_ent[id])
        }
    }
    
    if (
is_user_alive(id)) set_user_gravity(id1.0)
    
    
para_ent[id] = 0
}

public 
client_PreThink(id)
{
    
//parachute.mdl animation information
    //0 - deploy - 84 frames
    //1 - idle - 39 frames
    //2 - detach - 29 frames
    
    
if (!get_pcvar_num(pEnabled)) return
    if (!
is_user_alive(id) || !access(id,PARACHUTE_LEVEL)) return
    
    new 
Float:fallspeed get_pcvar_float(pFallSpeed) * -1.0
    
new Float:frame
    
    
new button get_user_button(id)
    new 
oldbutton get_user_oldbutton(id)
    new 
flags get_entity_flags(id)
    
    if (
para_ent[id] > && (flags FL_ONGROUND)) {
        
        if (
get_pcvar_num(pDetach)) {
            
            if (
get_user_gravity(id) == 0.1set_user_gravity(id1.0)
            
            if (
entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
                
entity_set_int(para_ent[id], EV_INT_sequence2)
                
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                
entity_set_float(para_ent[id], EV_FL_frame0.0)
                
entity_set_float(para_ent[id], EV_FL_fuser10.0)
                
entity_set_float(para_ent[id], EV_FL_animtime0.0)
                
entity_set_float(para_ent[id], EV_FL_framerate0.0)
                return
            }
            
            
frame entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
            entity_set_float
(para_ent[id],EV_FL_fuser1,frame)
            
entity_set_float(para_ent[id],EV_FL_frame,frame)
            
            if (
frame 254.0) {
                
remove_entity(para_ent[id])
                
para_ent[id] = 0
            
}
        }
        else {
            
remove_entity(para_ent[id])
            
set_user_gravity(id1.0)
            
para_ent[id] = 0
        
}
        
        return
    }
    
    if (
button IN_USE) {
        
        new 
Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
        if (
velocity[2] < 0.0) {
            
            if(
para_ent[id] <= 0) {
                
para_ent[id] = create_entity("info_target")
                if(
para_ent[id] > 0) {
                    
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
                    
entity_set_edict(para_ent[id], EV_ENT_aimentid)
                    
entity_set_edict(para_ent[id], EV_ENT_ownerid)
                    
entity_set_int(para_ent[id], EV_INT_movetypeMOVETYPE_FOLLOW)
                    
entity_set_model(para_ent[id], "models/parachute.mdl")
                    
entity_set_int(para_ent[id], EV_INT_sequence0)
                    
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                    
entity_set_float(para_ent[id], EV_FL_frame0.0)
                    
entity_set_float(para_ent[id], EV_FL_fuser10.0)
                }
            }
            
            if (
para_ent[id] > 0) {
                
                
entity_set_int(idEV_INT_sequence3)
                
entity_set_int(idEV_INT_gaitsequence1)
                
entity_set_float(idEV_FL_frame1.0)
                
entity_set_float(idEV_FL_framerate1.0)
                
set_user_gravity(id0.1)
                
                
velocity[2] = (velocity[2] + 40.0 fallspeed) ? velocity[2] + 40.0 fallspeed
                entity_set_vector
(idEV_VEC_velocityvelocity)
                
                if (
entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
                    
                    
frame entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
                    entity_set_float
(para_ent[id],EV_FL_fuser1,frame)
                    
entity_set_float(para_ent[id],EV_FL_frame,frame)
                    
                    if (
frame 100.0) {
                        
entity_set_float(para_ent[id], EV_FL_animtime0.0)
                        
entity_set_float(para_ent[id], EV_FL_framerate0.4)
                        
entity_set_int(para_ent[id], EV_INT_sequence1)
                        
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                        
entity_set_float(para_ent[id], EV_FL_frame0.0)
                        
entity_set_float(para_ent[id], EV_FL_fuser10.0)
                    }
                }
            }
        }
        else if (
para_ent[id] > 0) {
            
remove_entity(para_ent[id])
            
set_user_gravity(id1.0)
            
para_ent[id] = 0
        
}
    }
    else if ((
oldbutton IN_USE) && para_ent[id] > ) {
        
remove_entity(para_ent[id])
        
set_user_gravity(id1.0)
        
para_ent[id] = 0
    
}


Last edited by TheWhitesmith; 11-22-2017 at 10:26. Reason: bad idea to use is_user_connected, using 1 <= id <= 32 instead
TheWhitesmith is offline
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 11-22-2017 , 11:05   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #248

Quote:
Originally Posted by TheWhitesmith View Post
I expect that your mod has some sort of Monsters/NPC Players (not real players, and they do not appear in scoreboard)
Anyway it is fixed, there you go:
Greetings,

Thanks for the edits, I'll be testing the code within 24 hours.

Also, the server runs Deathrun_Manager by xPaw which has a "Fake Player" on Terrorists with -1000 score, and basically all it does it Team Balance for DR. Keep it strict to keep no more than 1 terrorist and every other player, a Counter-Terrorist.

Hope that makes sense.
Also I assume, your previous code somehow relates to Bots/NPCs/Fake Players?

Warm Regards,
ZEDD
ZEDD_Intensity is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-22-2017 , 11:36   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #249

This is not going to be a problem, I think the bot here has to block round end. An example is if a terrorist disconnects then the bot is alive and the round does not end, then the plugin brings another player to Terrorists team. (I've already seen some deathrun mods, this is what it does. I dont know if it's the same plugin or maybe another one but this is how it should work)
TheWhitesmith is offline
anash
Junior Member
Join Date: May 2018
Old 06-16-2018 , 16:08   Re: Parachute 1.3 (KRoTaL)
Reply With Quote #250

Any way to make parachute only for admins ?
anash 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 14:56.


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