Raised This Month: $ Target: $400
 0% 

[BB] Last Human


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-08-2014 , 10:57   Re: [BB] Last Human
Reply With Quote #11

By the way, this plugin is only for counter-terrorist?
Code:
    get_players( Players, iNum, "ae", "CT" )
zmd94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-08-2014 , 15:24   Re: [BB] Last Human
Reply With Quote #12

Quote:
Originally Posted by zmd94 View Post
By the way, this plugin is only for counter-terrorist?
Code:
    get_players( Players, iNum, "ae", "CT" )
Since CTs are humans and Ts are zombies and the name of the plugin is Last Human, i think so.
__________________
Jhob94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-08-2014 , 19:13   Re: [BB] Last Human
Reply With Quote #13

My mistake. I forgot about that. ;)
zmd94 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 12-11-2014 , 01:13   Re: [BB] Last Human
Reply With Quote #14

Quote:
Originally Posted by Linkin Hisoka View Post
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <Colorchat>

#pragma tabsize 0

new szName[33],g_speed[33]
/*------------------------- 2 Jump ----------------------------*/

new g_maxJumps 0
new 
jumpnum[33] = 0;
new 
bool:dojump[33] = false;
new 
g_itemid_multijump;
new 
g_multijumps[33] = 0;

/*------------------------- Unlimited clip ----------------------------*/
// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif
const OFFSET_LINUX_WEAPONS 4

// Max Clip for weapons
new const MAXCLIP[] = { -113, -11017, -1303013020253035251220,
10301008303020273030, -150 }

new 
g_has_unlimited_clip[33]
/*------------------------- plugin_init ----------------------------*/

public plugin_init( )
{
    
register_plugin"Last Survivor""1.0""Hisoka" )
    
register_event"DeathMsg""EventDeath""a" )
    
    
register_forward(FM_PlayerPreThink"FW_PlayerPreThinkz")
    
register_forward(FM_PlayerPostThink"FW_PlayerPostThinkz")
    
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
register_event("CurWeapon""change_weapon""be""1=1")
    
register_event("HLTV""event_new_round""a""1=0""2=0")  
    
}

/*------------------------- Last Survivor ----------------------------*/

public EventDeath( )
{
    new 
Players32 ]
    new 
iNum
    
    get_players
PlayersiNum"ae""CT" )
    
    if( 
iNum == )
    {
        for (new 
0iNumi++)
        {
            
get_user_name(Players[i], szName32)
            
            
set_user_health(Players[i], 500)
            
set_user_maxspeed(Players[i], get_user_maxspeed(Players[i]) + 450)
            
            
g_multijumps[Players[i]] = true
            g_has_unlimited_clip
[Players[i]] = true
            g_speed
[Players[i]] = true
            
            ColorChat
(0GREEN"[ Base Builder ] ^1Player ^4%s ^1Is The Last Survivor With Unlimited Clip ^4!",szName)
        }
    }
}

/*--------------------------------------------------------------*/

public event_new_round(id)
{
    for (new 
idid <= 32id++) g_multijumps[id] = false;
    for (new 
idid <= 32id++) g_has_unlimited_clip[id] = false;
}

public 
change_weapon(id)
{
    if(
g_speed[id]) set_user_maxspeed(idget_user_maxspeed(id) + 450)
}
/*------------------------- 2 Jump ----------------------------*/

public FW_PlayerPreThinkz(id)
{
    if(!
g_multijumps[id]) return PLUGIN_CONTINUE
    
new nbut pev(id,pev_button);
    new 
obut pev(id,pev_oldbuttons);
    if((
nbut IN_JUMP) && !(pev(id,pev_flags) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < 1)
        {
            
dojump[id] = true;
            
jumpnum[id]++;
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
FW_PlayerPostThinkz(id)
{
    if(!
g_multijumps[id]) return PLUGIN_CONTINUE
    
if(dojump[id] == true)
    {
        new 
Float:velocity[3];
        
pev(id,pev_velocity,velocity);
        
velocity[2] = random_float(265.0,285.0);
        
set_pev(id,pev_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}    


public 
Jump(playeritemid)
{
    if (
itemid == g_itemid_multijump){
        if (
g_multijumps[player] < g_maxJumps || !g_maxJumps){
            
g_multijumps[player]++;
            if (
g_maxJumps)
                
client_print(playerprint_center""g_multijumps[player], g_maxJumps);
            else
                
client_print(playerprint_center""g_multijumps[player]);
        }
        else
            
client_print(playerprint_center""g_maxJumps);
    }
}

/*------------------------- Unlimited clip ----------------------------*/

public message_cur_weapon(msg_idmsg_destmsg_entity)
{
    
    if (!
g_has_unlimited_clip[msg_entity])
        return;
    
    
    if (!
is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
    
    static 
weaponclip
    weapon 
get_msg_arg_int(2
    
clip get_msg_arg_int(3
    
    
    if (
MAXCLIP[weapon] > 2
    {
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon]) 
        
        if (
clip 2
        {
            
            static 
wname[32], weapon_ent
            get_weaponname
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owners(-1wnamemsg_entity)
            
            
            
fm_set_weapon_ammos(weapon_entMAXCLIP[weapon])
        }
    }
}


stock fm_find_ent_by_owners(entity, const classname[], owner)
{
    
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}


stock fm_set_weapon_ammos(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);

HLTV round restart does not pass player ids.

Take a look back at my last post about what I said.

It had something to do with "arrayset"

PHP Code:
arrayset g_multijumpsfalseg_multijumps[] ) 
PHP Code:
arrayset g_has_unlimited_clipfalseg_has_unlimited_clip[] ) 
__________________
Blizzard_87 is offline
GX_JazZ
Member
Join Date: Dec 2014
Old 12-14-2014 , 07:23   Re: [BB] Last Human
Reply With Quote #15

Good job , I liked this plugin
GX_JazZ is offline
Send a message via Skype™ to GX_JazZ
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-14-2014 , 07:32   Re: [BB] Last Human
Reply With Quote #16

This plugin can be optimized more.

https://forums.alliedmods.net/showpo...07&postcount=9
zmd94 is offline
Drissdev1
Senior Member
Join Date: Jun 2014
Old 12-17-2014 , 16:54   Re: [BB] Last Human
Reply With Quote #17

__________________
Drissdev1 is offline
Linkin Hisoka
Senior Member
Join Date: Sep 2014
Location: Morocco, Marrakesh
Old 12-18-2014 , 15:28   Re: [BB] Last Human
Reply With Quote #18

hahahahhahahahhahahahhahahahhahahahhahahahhah ahahhahahahhahahahhahahahhahahahhahahahhahaha hhahahahhahahahhahahahhahahahhahahahhahahahha hahahhahahahhahahahhahahahhahahah DRiSS :')
__________________
Moroccan and proud
Linkin Hisoka 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 21:13.


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