Raised This Month: $ Target: $400
 0% 

RPG mod by Sylwester


Post New Thread Reply   
 
Thread Tools Display Modes
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-25-2011 , 06:10   Re: RPG mod by Sylwester
Reply With Quote #101

If you search for defines UPG_* you can find out where it uses upgrade levels stored in g_p_upg[ player_id ][ upgrade_id ]. Upgrades don't have separate functions, but they are implemented directly in functions like player spawn (health, stealth, denial), damage event (vampiric, impulse, icestab, frostpistol) etc.
__________________
Impossible is Nothing
Sylwester is offline
UalasB
Junior Member
Join Date: Jun 2011
Old 06-25-2011 , 11:54   Re: RPG mod by Sylwester
Reply With Quote #102

Got it, thanks!
UalasB is offline
UalasB
Junior Member
Join Date: Jun 2011
Old 06-25-2011 , 15:01   Re: RPG mod by Sylwester
Reply With Quote #103

Quote:
case UPG_GRA:{
if(!is_user_alive(id))
return
if(g_in_team && g_in_team != g_p_team[id])
return
set_user_gravity(id, 0.75)
}
I'm doing this way, but in the next round/map the gravity set automatically to the default, how can i make it continue all long, like your upgrades.
UalasB is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-25-2011 , 18:19   Re: RPG mod by Sylwester
Reply With Quote #104

you should do it in player spawn
example:
PHP Code:
player_spawn(id){
//code...

    
set_user_gravity(id1.0 0.1*g_p_upg[id][UPG_GRA])

//code...

__________________
Impossible is Nothing
Sylwester is offline
UalasB
Junior Member
Join Date: Jun 2011
Old 06-27-2011 , 16:52   Re: RPG mod by Sylwester
Reply With Quote #105

Thank's sir!
UalasB is offline
UalasB
Junior Member
Join Date: Jun 2011
Old 07-02-2011 , 23:04   Re: RPG mod by Sylwester
Reply With Quote #106

PHP Code:
public damage_event(id){
    new 
victim_id id;
    if( !
is_user_connectedvictim_id ) ) return PLUGIN_CONTINUE
    
new dmg_take read_data);
    new 
dmgtype read_data);
    new 
Float:damage dmg_take 0.1 g_p_upg[id][UPG_ARMA];
    new 
health get_user_healthvictim_id );
    new 
frag get_user_frags(id);
    new 
iWeapIDattacker_id get_user_attackervictim_idiWeapID );


    if( !
is_user_connectedattacker_id ) || !is_user_alivevictim_id ) ) {
        return 
PLUGIN_HANDLED
    
}
    if( 
iWeapID == CSW_KNIFE && g_p_upg[id][UPG_ARMA]) {
        
        if( 
floatround(damage) >= health ) {
            if( 
victim_id == attacker_id ) {
                return 
PLUGIN_CONTINUE
                
}else{
                
log_killattacker_idvictim_id"knife");
            }
                
            return 
PLUGIN_CONTINUE
            
}else {
            if( 
victim_id == attacker_id ) return PLUGIN_CONTINUE

            fakedamage
victim_id"weapon_knife"damagedmgtype);
            
set_user_frags(idfrag++)
        }
    }

//REST OF YOUR CODE 
How can i fix that?

Edit2: How Denial works? I've tried to die with weapons, but in the nextround i didn't spawn with the weapons.

Last edited by UalasB; 07-02-2011 at 23:10.
UalasB is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-03-2011 , 02:56   Re: RPG mod by Sylwester
Reply With Quote #107

Fix what? You didn't say what is wrong with your code.

When player dies (player_death function) it sets g_c_denial to use denial on next spawn unless g_c_denial was set to block.
When player spawns (player_spawn function) it clears denial block or set it to give back weapons.
If denial was set to give back weapons it restores player weapons in timer function (timer_cycle).
__________________
Impossible is Nothing
Sylwester is offline
UalasB
Junior Member
Join Date: Jun 2011
Old 07-03-2011 , 20:11   Re: RPG mod by Sylwester
Reply With Quote #108

1.How can i make the CT's don't get killing XP?

2.I've tried to give, to the CT's, XP per round played(1lvl for 3 rounds played)

PHP Code:
public logevent_round_startidlevelcid ){
    
g_freezetime false
    
// START TEST CODE
    
static players[MAX_PLAYERS], pnumarg[32], args[63], tmpamountijname[32]
    
read_argv(1arg31)
    
pnum 0
    amount 
1
    
if( ( ++iRound ROUND_INTERVALO ) == && cs_get_user_team(id) == CS_TEAM_CT ){
        if (!
cmd_access(idlevelcid4))
            return 
PLUGIN_HANDLED
        
        
        
for(i=0i<pnumi++){
            
g_p_level[players[i]] += amount
            g_p_xp
[players[i]] = as_sum_fn(g_p_level[players[i]], XP_STARTXP_INC)
            
g_p_credits[players[i]] += amount CREDITS_PER_LVL
            g_p_progress
[players[i]] = 0
            set_default_lvl_upg
(players[i])//will not set lvl if player has lvl > default lvl
            
data_save(players[i])
        }
//STOP TEST CODE
        
    
}

3. I'm trying to make a different "rpgm_xp_mult" for the VIP players, its that correct?
PHP Code:
new pc_xp_vip
new Float:g_xp_vip
//AT INIT
 
pc_xp_vip register_cvar("rpgm_xp_vip""1.0"01.0)
//AT UPDATE_VARS PUBLIC'S
    
g_xp_vip get_pcvar_float(pc_xp_vip)
if(
g_xp_vip MAX_XP_MULTI)
    
g_xp_vip MAX_XP_MULTI
if(g_xp_vip 0.0)
    
g_xp_vip 0.0
//AT FN_ADDXP
if (get_user_flags(id) & ADMIN_RESERVATION) {
temp_xp floatround(xp*g_xp_vip)

Sorry for the mess, and thanks for the help.
UalasB is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-04-2011 , 16:48   Re: RPG mod by Sylwester
Reply With Quote #109

1. edit function fn_calcxp:
PHP Code:
public fn_calcxp(const type, const arg1, const arg2, const arg3){
    switch(
type){
        
//CXT_KILL - arg1: attacker, arg2: victim
        
case CXT_KILL: {
            if(
g_p_team[arg1] == 2)
                return 
0
            
return 100*lvl_diff_mod(arg1arg2)
        }
        
//CXT_DMG - arg1: attacker, arg2: victim, arg3: dmg_amount
        
case CXT_DMG: return arg3*lvl_diff_mod(arg1arg2)
    }
    return 
0

2.
PHP Code:
new g_rounds_counter[MAX_PLAYERS+1]

public 
client_connect(id){
    static 
i
    g_rounds_counter
[id] = 0
    
//old code...
}

public 
logevent_round_start(){
    
g_freezetime false
    
for(new i=1i<=g_max_playersi++){
        if(!
is_user_alive(i) || g_p_team[i] != 2)
            continue
        
g_rounds_counter[i]++
        if(
g_rounds_counter[i] >= 3){
            
g_rounds_counter[i] = 0
        
            g_p_level
[i]++
            
g_p_xp[i] = as_sum_fn(g_p_level[i], XP_STARTXP_INC)
            
g_p_credits[i] += CREDITS_PER_LVL
            g_p_progress
[i] = 0
        
}
    }

3.
PHP Code:
//AT FN_ADDXP
if (get_user_flags(id) & ADMIN_RESERVATION) {
    
temp_xp floatround(xp*g_xp_vip)
} else {
    
temp_xp floatround(xp*g_xp_multipler)

__________________
Impossible is Nothing

Last edited by Sylwester; 07-04-2011 at 16:52.
Sylwester is offline
UalasB
Junior Member
Join Date: Jun 2011
Old 07-05-2011 , 02:51   Re: RPG mod by Sylwester
Reply With Quote #110

Thank's, and i think this is the last one ^^
PHP Code:
public plugin_init()
{
  
RegisterHam(Ham_TakeDamage"player""Ham_damage");
}
public 
Ham_damage(idinflictorattackerFloat:damagedamagebits)
{
  if(
get_user_weapon(attacker) == CSW_USP)
  {
    
SetHamParamFloat(4damage * (10.0 g_p_upg[id][UPG_STEALTH]));
    return 
HAM_HANDLED;
  }
  return 
HAM_IGNORED;

When i test it apart, only this plugin,(with out the g_p_upg[id][UPG_STEALTH]_ it's works! But when i put it on RPG MOD like de code, i'ts doesn't work.
UalasB 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 08:30.


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