Raised This Month: $ Target: $400
 0% 

"Simple VIP", "0.0.1", "Alliedmodders"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-09-2014 , 09:32   "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #1

Can someone to add a function that VIP have a special player model?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define ExtraHealth 15.0
#define ExtraArmor 15.0
#define VipStartHealth 150.0
#define VipStartArmor 100.0
#define VipFlag ADMIN_LEVEL_H

enum
{
    
SCOREATTRIB_ARG_PLAYERID 1,
    
SCOREATTRIB_ARG_FLAGS
}

enum (<<= 1)
{
    
SCOREATTRIB_FLAG_NONE 0,
    
SCOREATTRIB_FLAG_DEAD,
    
SCOREATTRIB_FLAG_BOMB,
    
SCOREATTRIB_FLAG_VIP
}

public 
plugin_natives()
{
    
register_native("zp_get_user_vip2""_get_user_vip2"1)
}

public 
plugin_init()
{
    
register_plugin("Simple VIP""0.0.1""Alliedmodders")
    
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawnPost"1)
    
RegisterHam(Ham_Killed"player""OnPlayerKilled")
    
    
register_message(get_user_msgid("ScoreAttrib"), "OnScoreAttrib")
}

public 
OnPlayerSpawnPost(id)
{
    if(
is_user_alive(id) && (get_user_flags(id) & VipFlag))
    {
        new 
Float:cHealthFloat:cArmor
        pev
(idpev_healthcHealth)
        
pev(idpev_armorvaluecArmor)
        if(
cHealth VipStartHealthset_pev(idpev_healthVipStartHealth);
        if(
cArmor VipStartArmorset_pev(idpev_armorvalueVipStartArmor);
    }
}

public 
OnPlayerKilled(victimattacker)
{
    if(
victim == attacker) return;
    if(!
is_user_connected(attacker)) return;
    
    
set_pev(attackerpev_healthpev(attackerpev_health)+ExtraHealth)
    
set_pev(attackerpev_armorvaluepev(attackerpev_armorvalue)+ExtraArmor)
}

public 
OnScoreAttrib()
{
    new 
id get_msg_arg_int(SCOREATTRIB_ARG_PLAYERID)
    if(
get_user_flags(id) & VipFlagset_msg_arg_int(SCOREATTRIB_ARG_FLAGSARG_BYTESCOREATTRIB_FLAG_VIP);
}

public 
_get_user_vip2(id)
{
    return (
get_user_flags(id) & VipFlag);

I use cs_player_models_api - API to set player models by MeRcyLeZZ

Last edited by Krtola; 09-09-2014 at 09:32.
Krtola is offline
Send a message via Skype™ to Krtola
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 09-09-2014 , 11:19   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #2

Quote:
Originally Posted by Krtola View Post
Can someone to add a function that VIP have a special player model?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define ExtraHealth 15.0
#define ExtraArmor 15.0
#define VipStartHealth 150.0
#define VipStartArmor 100.0
#define VipFlag ADMIN_LEVEL_H

enum
{
    
SCOREATTRIB_ARG_PLAYERID 1,
    
SCOREATTRIB_ARG_FLAGS
}

enum (<<= 1)
{
    
SCOREATTRIB_FLAG_NONE 0,
    
SCOREATTRIB_FLAG_DEAD,
    
SCOREATTRIB_FLAG_BOMB,
    
SCOREATTRIB_FLAG_VIP
}

public 
plugin_natives()
{
    
register_native("zp_get_user_vip2""_get_user_vip2"1)
}

public 
plugin_init()
{
    
register_plugin("Simple VIP""0.0.1""Alliedmodders")
    
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawnPost"1)
    
RegisterHam(Ham_Killed"player""OnPlayerKilled")
    
    
register_message(get_user_msgid("ScoreAttrib"), "OnScoreAttrib")
}

public 
OnPlayerSpawnPost(id)
{
    if(
is_user_alive(id) && (get_user_flags(id) & VipFlag))
    {
        new 
Float:cHealthFloat:cArmor
        pev
(idpev_healthcHealth)
        
pev(idpev_armorvaluecArmor)
        if(
cHealth VipStartHealthset_pev(idpev_healthVipStartHealth);
        if(
cArmor VipStartArmorset_pev(idpev_armorvalueVipStartArmor);
    }
}

public 
OnPlayerKilled(victimattacker)
{
    if(
victim == attacker) return;
    if(!
is_user_connected(attacker)) return;
    
    
set_pev(attackerpev_healthpev(attackerpev_health)+ExtraHealth)
    
set_pev(attackerpev_armorvaluepev(attackerpev_armorvalue)+ExtraArmor)
}

public 
OnScoreAttrib()
{
    new 
id get_msg_arg_int(SCOREATTRIB_ARG_PLAYERID)
    if(
get_user_flags(id) & VipFlagset_msg_arg_int(SCOREATTRIB_ARG_FLAGSARG_BYTESCOREATTRIB_FLAG_VIP);
}

public 
_get_user_vip2(id)
{
    return (
get_user_flags(id) & VipFlag);

I use cs_player_models_api - API to set player models by MeRcyLeZZ

IF I understand u right. u want change model for vip ?
Eviatar Mor is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-09-2014 , 13:47   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #3

This vip plugin dont have special model for vip players.
I need to add that function.
Krtola is offline
Send a message via Skype™ to Krtola
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-09-2014 , 22:25   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #4

Plugin


Change this check " if(!_native_check_is_zombie(id))" to native that you need to check is player zombie.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-09-2014 , 22:31   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #5

It seems that you still want to have custom model for this plugin.

Last edited by zmd94; 09-09-2014 at 22:32.
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-10-2014 , 04:29   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #6

Quote:
Originally Posted by yokomo View Post
Plugin


Change this check " if(!_native_check_is_zombie(id))" to native that you need to check is player zombie.
Thanks you. If I understand correctly it checks that cancels special model when a player is infected and turned into zombies?
If so, in my case it would seem like this:
PHP Code:
//Set player model here.
        
if(!is_user_zombie(id)) cs_set_player_model(idVipModel);
    }

One more question please,can you add to wryte VIP front of the player name,and start money for vip ?

Last edited by Krtola; 09-10-2014 at 05:11.
Krtola is offline
Send a message via Skype™ to Krtola
Old 09-10-2014, 05:08
GinNNy
This message has been deleted by GinNNy. Reason: Yokomo posted it
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-10-2014 , 12:13   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #7

I added the following:
PHP Code:
#include <cstrike> 
Then in
PHP Code:
public OnPlayerSpawnPost(id
add
PHP Code:
cs_set_user_money(idcs_get_user_money(id)+(3000)); 
I tried it and works nicely.I hope this is a good way to get money for vip.

I also took code from zmd94 plugin for multi-jump and add in this vip :
PHP Code:
new cvar_max_jumpscvar_human_jumpscvar_zombie_jumps
new JumpCount[33
PHP Code:
RegisterHam(Ham_Player_Jump"player""fw_PlayerJump"0
PHP Code:
cvar_max_jumps register_cvar("zp_max_jump""3")
    
cvar_human_jumps register_cvar("zp_human_jump""1")
    
cvar_zombie_jumps register_cvar("zp_zombie_jump""1"
PHP Code:
public fw_PlayerJump(id

    if(
is_user_alive(id) && get_user_flags(id) & VipFlag
    { 
        new 
Flags pev(idpev_flags
         
        if(
Flags FL_WATERJUMP || pev(idpev_waterlevel) >= || !(get_pdata_int(id246) & IN_JUMP)) 
        { 
            return 
HAM_IGNORED 
        

        if( 
is_user_zombie(id) && get_pcvar_num(cvar_zombie_jumps) == 0)  
        { 
            return 
HAM_IGNORED 
        

        if(!
is_user_zombie(id) && get_pcvar_num(cvar_human_jumps) == 0)  
        { 
            return 
HAM_IGNORED 
        

        if(
Flags FL_ONGROUND)  
        { 
            
JumpCount[id] = 
            
return HAM_IGNORED 
        

        new 
Multi get_pcvar_num(cvar_max_jumps
        if( 
Multi )  
        { 
            if( 
get_pdata_float(id251) < 500 && ++JumpCount[id] <= Multi )  
            { 
                new 
Float:fVelocity
                
pevidpev_velocityfVelocity 
                
fVelocity] = 268.328157 
                set_pev
idpev_velocityfVelocity 
                 
                return 
HAM_HANDLED 
            

        } 
    } 
    return 
HAM_IGNORED 

And now vip have multi-jump and extra money.I hope that this good idea.I have tested and works.
I can not add that writes VIP in front of the player's name(in chat).
Krtola is offline
Send a message via Skype™ to Krtola
plazma
Senior Member
Join Date: Oct 2013
Old 09-10-2014 , 12:32   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #8

This work on ZPA mod ?
__________________
Free Palestine ♥
plazma is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-10-2014 , 13:11   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #9

Just learn from this code:
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-11-2014 , 05:48   Re: "Simple VIP", "0.0.1", "Alliedmodders"
Reply With Quote #10

Thanks,I set everything I needed.
plazma you can use for ZP yokomo version.
Krtola is offline
Send a message via Skype™ to Krtola
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 01:04.


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