Raised This Month: $13 Target: $400
 3% 

Need help for powers code


Post New Thread Reply   
 
Thread Tools Display Modes
Mr.J
Senior Member
Join Date: Sep 2017
Location: cs_assault
Old 01-02-2018 , 11:58   Re: Need help for powers code
Reply With Quote #11

Quote:
Originally Posted by D3XT3R View Post
gunxpmod powers and an old version since 2013-2014
Its matter that i have it bcz it is private
Mr.J is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: Catlands
Old 01-02-2018 , 12:06   Re: Need help for powers code
Reply With Quote #12

This must work, id is already defined insinde each func.
Code:
public AddHealth(id){     if (is_user_alive(id)) return 0;     set_user_health(id, get_user_health(id) + (20*HealthLevel[id]));     Refreshing[id] = false;     return 1; } public NeverEndingRegen(id){     if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT && !Refreshing[id]) return 0;         set_user_health(id, get_user_health(id) + RegenLevel[id]);     return 1; }
__________________
Relaxing is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-02-2018 , 12:06   Re: Need help for powers code
Reply With Quote #13

So, the code you post at the main post is part of the GunXP mod code?
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
Mr.J
Senior Member
Join Date: Sep 2017
Location: cs_assault
Old 01-02-2018 , 12:37   Re: Need help for powers code
Reply With Quote #14

Quote:
Originally Posted by Relaxing View Post
This must work, id is already defined insinde each func.
Code:
public AddHealth(id){     if (is_user_alive(id)) return 0;     set_user_health(id, get_user_health(id) + (20*HealthLevel[id]));     Refreshing[id] = false;     return 1; } public NeverEndingRegen(id){     if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT && !Refreshing[id]) return 0;         set_user_health(id, get_user_health(id) + RegenLevel[id]);     return 1; }
every zombie have his own HP , you can Upgrade level of health and regen HP , but does not regen HP and increase HP amount . and if you need the code to fix it, i will send it to you in private

Quote:
Originally Posted by zmd94 View Post
So, the code you post at the main post is part of the GunXP mod code?
this code are alone , but have big relationship of gunxpmod (you can say part of it)

Last edited by Mr.J; 01-02-2018 at 12:46.
Mr.J is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-03-2018 , 03:54   Re: Need help for powers code
Reply With Quote #15

Quote:
Originally Posted by Mr.J View Post
Its matter that i have it bcz it is private
You are genius!
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Prestige System"
#define VERSION "1.0"
#define AUTHOR "FuckTheSchool"

#define MAX_LEVEL 6
#define PowerNum 5

native get_user_prestige(id)
native set_user_prestige(idamount)
native get_user_ever_prestige(id)
native get_user_save_method(id)

new 
PrestigeVault
new SpeedLevel[33], HealthLevel[33], DamageLevel[33], GravityLevel[33], RegenLevel[33], MaxHealth[33], Refreshing[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /power""CMD_Prestige")
    
register_clcmd("say /powers""CMD_Prestige")
    
    
register_event("CurWeapon","event_curweapon","be""1=1")
    
    
RegisterHam(Ham_Spawn"player""CheckSpawn")
    
RegisterHam(Ham_TakeDamage"player""TakeDamage")
    
set_task(1.0"NeverEndingRegen",_,_,_,"b")
}

public 
plugin_cfg()
{
    
PrestigeVault nvault_open"PrestigeSystem" );
    
    if ( 
PrestigeVault == INVALID_HANDLE )
        
set_fail_state"Error opening Prestige System nVault, file does not exist!" );
}

public 
plugin_end()
{
    
nvault_close(PrestigeVault)    
}
public 
client_authorized(id)
{
    
LoadPowers(id)
}

public 
client_disconnect(id)
{
    
SavePowers(id)
    
    
SpeedLevel[id] = 0
    HealthLevel
[id] = 0
    DamageLevel
[id] = 0
    GravityLevel
[id] = 0
    RegenLevel
[id] = 0
}

public 
CheckSpawn(id)
{
    
MaxHealth[id] = 100
    Refreshing
[id] = true
    set_task
(0.5"AddHealth"id)
    
    if(
GravityLevel[id] > 0)
        
set_task(0.5"AddGravity"id)
}

public 
AddHealth(id)
{
    
set_user_health(idget_user_health(id) + (20*HealthLevel[id]))
    
    if(
get_user_health(id) > 100.0)
        
MaxHealth[id] = get_user_health(id)
        
    else
        
MaxHealth[id] = 100
        
    Refreshing
[id] = false
}

public 
AddGravity(id)
{
    new 
Num = (800 GravityLevel[id]*30)/800
    set_user_gravity
(id1.0 Num)
}

public 
event_curweapon(id)
{
    if(
SpeedLevel[id] > 0)
        
set_task(0.5"SetSpeed"id)
}

public 
SetSpeed(id)
{
    
set_user_maxspeed(idget_user_maxspeed(id) +(20*SpeedLevel[id]))    
}

public 
TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(
victim != attacker)
    {
        if(
DamageLevel[attacker] > 0)
        {
            
SetHamParamFloat(4damage * (1.0 + (DamageLevel[attacker] * 0.2)))
        }
    }
}

public 
NeverEndingRegen()
{
    new 
players[32], num
    get_players
(playersnum"ach")
    
    for(new 
id;id num;id++)
    {
        new 
players[id]
        if(
RegenLevel[i] > && !Refreshing[id])
        {
            if((
get_user_health(i) + RegenLevel[i]) > MaxHealth[i]) set_user_health(iMaxHealth[i])
            else 
set_user_health(iget_user_health(i) + RegenLevel[i])
        }
    }
}

public 
CMD_Prestige(id)
{
    new 
Format[100], StrFloat[4]
    
    
formatex(Formatcharsmax(Format), "Powers: [Prestiges: %i ( Total: %i )]"get_user_prestige(id), get_user_ever_prestige(id))
    
    new 
PrestigeMenu menu_create(Format"HandleCMD_Prestige")
    
    
float_to_str(250.0 + (20*(SpeedLevel[id]+1)), StrFloatcharsmax(StrFloat))
    
    
formatex(Formatcharsmax(Format), "%sSpeed \d[\yLevel %i\d][\r%s units\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(SpeedLevel[id]) ? "\w" "\d"SpeedLevel[id], StrFloatPrice(SpeedLevel[id]), Price(SpeedLevel[id]) == "" "s"SpeedLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
formatex(Formatcharsmax(Format), "%sHealth \d[\yLevel %i\d][\r+%i health\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(HealthLevel[id]) ? "\w" "\d"HealthLevel[id], (HealthLevel[id]+1)*20Price(HealthLevel[id]), Price(HealthLevel[id]) == "" "s"HealthLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
float_to_str(1.0 + (0.2*(DamageLevel[id]+1)), StrFloatcharsmax(StrFloat))
    
formatex(Formatcharsmax(Format), "%sDamage \d[\yLevel %i\d][\r%sx\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(DamageLevel[id]) ? "\w" "\d"DamageLevel[id], StrFloatPrice(DamageLevel[id]), Price(DamageLevel[id]) == "" "s"DamageLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
float_to_str((800.0 GravityLevel[id]*30)/800StrFloatcharsmax(StrFloat))
    
formatex(Formatcharsmax(Format), "%sGravity \d[\yLevel %i\d][\r%s Gravity\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(GravityLevel[id]) ? "\w" "\d"GravityLevel[id], 800-(30*GravityLevel[id]), Price(GravityLevel[id]), Price(GravityLevel[id]) == "" "s"GravityLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
formatex(Formatcharsmax(Format), "%sHP Regeneration \d[\yLevel %i\d][\r%i HP/Sec\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(RegenLevel[id]) ? "\w" "\d"RegenLevel[id], RegenLevel[id], Price(RegenLevel[id]), Price(RegenLevel[id]) == "" "s"RegenLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
formatex(Formatcharsmax(Format), "Reset Powers \d[\rFree\d]")
    
menu_additem(PrestigeMenuFormat)
    
    
menu_display(idPrestigeMenu)

}

public 
HandleCMD_Prestige(idPrestigeMenuitem)
{
    if(
item == MENU_EXIT) return;
    
    switch(
item+1)
    {    
        case 
1:
        {
            if(
get_user_prestige(id) >= Price(SpeedLevel[id]) && SpeedLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(SpeedLevel[id]))
                
SpeedLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Speed Upgrade!")
            }
        }
        
        case 
2:
        {    
            if(
get_user_prestige(id) >= Price(HealthLevel[id]) && HealthLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(HealthLevel[id]))
                
HealthLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Health Upgrade!")
            }
        }
        
        case 
3:
        {
            if(
get_user_prestige(id) >= Price(DamageLevel[id]) && DamageLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(DamageLevel[id]))
                
DamageLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Health Upgrade!")
            }
        }
        
        case 
4:
        {
            if(
get_user_prestige(id) >= Price(GravityLevel[id]) && GravityLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(GravityLevel[id]))
                
GravityLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Gravity Upgrade!")
            }
        }
        
        case 
5:
        {
            if(
get_user_prestige(id) >= Price(RegenLevel[id]) && RegenLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(RegenLevel[id]))
                
RegenLevel[id]++;
                
ColorChat(id"^4Congratulations on buying HP Regeneration Upgrade!")
            }
        }
        case 
PowerNum+1:
        {
            
HealthLevel[id] = 0
            SpeedLevel
[id] = 0
            DamageLevel
[id] = 0
            GravityLevel
[id] = 0
            RegenLevel
[id] = 0
            set_user_prestige
(idget_user_ever_prestige(id))
            
ColorChat(id"^4You have successfuly reset your powers!")
        }
    }
    if(
item != MENU_EXIT)
    {
        
CMD_Prestige(id)
        
SavePowers(id)
    }
    
}

SavePowers(id)

    new 
szAuth[33];
    new 
szKey[64];

    if ( 
get_user_save_method(id) == 0)
    {
        
get_user_ipidszAuth charsmax(szAuth), 1);
        
formatexszKey 63 "%s-IP" szAuth);
    }
    else if ( 
get_user_save_method(id) == )
    {
        
get_user_authidid szAuth charsmax(szAuth) );
        
formatexszKey 63 "%s-ID" szAuth);
    }
    
    new 
szData[256];
    
    
formatex(szData255"%i#%i#%i#%i#%i#"SpeedLevel[id], HealthLevel[id], DamageLevel[id], GravityLevel[id], RegenLevel[id])
        
    
nvault_setPrestigeVault szKey szData );
}

LoadPowers(id)
{
    new 
szAuth[33];
    new 
szKey[40], szKey2[40];
    new 
BestBest2
    
// Best save is loaded
    
get_user_ipidszAuth charsmax(szAuth), 1);
    
formatexszKey 63 "%s-IP" szAuth);
    
    
get_user_authidid szAuth charsmax(szAuth) );
    
formatexszKey2 63 "%s-ID" szAuth);
    
    new 
szData[256], szData2[256];

    
formatex(szData255"%i#%i#%i#%i#%i#"SpeedLevel[id], HealthLevel[id], DamageLevel[id], GravityLevel[id], RegenLevel[id]) 
    
formatex(szData2255"%i#%i#%i#%i#%i#"SpeedLevel[id], HealthLevel[id], DamageLevel[id], GravityLevel[id], RegenLevel[id]) 
        
    
nvault_get(PrestigeVaultszKeyszData255)
    
replace_all(szData 255"#"" ")
    
    
nvault_get(PrestigeVaultszKey2szData2255)
    
replace_all(szData2 255"#"" ")
    
    new 
speed[32], health[32], damage[32], gravity[32], regen[32], speed2[32], health2[32], damage2[32], gravity2[32], regen2[32]
    
parse(szDataspeed31health31damage31gravity31regen31)
    
parse(szData2speed231health231damage231gravity231regen231)
    
    
Best str_to_num(speed) + str_to_num(health) + str_to_num(damage) + str_to_num(gravity) + str_to_num(regen)
    
Best2 str_to_num(speed2) + str_to_num(health2) + str_to_num(damage2) + str_to_num(gravity2) + str_to_num(regen2)
    
    if(
Best Best2)
    {
        
SpeedLevel[id] = str_to_num(speed)
        
HealthLevel[id] = str_to_num(health)
        
DamageLevel[id] = str_to_num(damage)
        
GravityLevel[id] = str_to_num(gravity)
        
RegenLevel[id] = str_to_num(regen)
    }
    else
    {
        
SpeedLevel[id] = str_to_num(speed2)
        
HealthLevel[id] = str_to_num(health2)
        
DamageLevel[id] = str_to_num(damage2)
        
GravityLevel[id] = str_to_num(gravity2)
        
RegenLevel[id] = str_to_num(regen2)
    }
}

stock Price(LevelAmount)
{
    new 
Value 1
    Value 
Value + (LevelAmount*2)
    
    return 
Value
}

stock ColorChat(const index, const string[], {FloatSqlResul,_}:...) 
{
    new 
msg[191], players[32], count 1Prefix[32];
    
get_cvar_string("amx_prefix_cvar"Prefix31);
    
    static 
len;
    
len formatex(msgcharsmax(msg), "^4[ %s ]^1 "Prefix);
    
vformat(msg[len], charsmax(msg) - lenstring3);
    
replace_all(msg,190,"/g","^4");// green txt
    
replace_all(msg,190,"/y","^1");// orange txt
    
replace_all(msg,190,"/ctr","^3");// team txt
    
replace_all(msg,190,"/w","^0");// team txt
    
    
if(index)    players[0] = index;
    else    
get_players(players,count,"ch");
    
    for (new 
0counti++)
    {
        if(
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"),_players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
    }

__________________

Last edited by D3XT3R; 01-03-2018 at 04:01.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Mr.J
Senior Member
Join Date: Sep 2017
Location: cs_assault
Old 01-03-2018 , 11:43   Re: Need help for powers code
Reply With Quote #16

Quote:
Originally Posted by D3XT3R View Post
You are genius!
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Prestige System"
#define VERSION "1.0"
#define AUTHOR "FuckTheSchool"

#define MAX_LEVEL 6
#define PowerNum 5

native get_user_prestige(id)
native set_user_prestige(idamount)
native get_user_ever_prestige(id)
native get_user_save_method(id)

new 
PrestigeVault
new SpeedLevel[33], HealthLevel[33], DamageLevel[33], GravityLevel[33], RegenLevel[33], MaxHealth[33], Refreshing[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /power""CMD_Prestige")
    
register_clcmd("say /powers""CMD_Prestige")
    
    
register_event("CurWeapon","event_curweapon","be""1=1")
    
    
RegisterHam(Ham_Spawn"player""CheckSpawn")
    
RegisterHam(Ham_TakeDamage"player""TakeDamage")
    
set_task(1.0"NeverEndingRegen",_,_,_,"b")
}

public 
plugin_cfg()
{
    
PrestigeVault nvault_open"PrestigeSystem" );
    
    if ( 
PrestigeVault == INVALID_HANDLE )
        
set_fail_state"Error opening Prestige System nVault, file does not exist!" );
}

public 
plugin_end()
{
    
nvault_close(PrestigeVault)    
}
public 
client_authorized(id)
{
    
LoadPowers(id)
}

public 
client_disconnect(id)
{
    
SavePowers(id)
    
    
SpeedLevel[id] = 0
    HealthLevel
[id] = 0
    DamageLevel
[id] = 0
    GravityLevel
[id] = 0
    RegenLevel
[id] = 0
}

public 
CheckSpawn(id)
{
    
MaxHealth[id] = 100
    Refreshing
[id] = true
    set_task
(0.5"AddHealth"id)
    
    if(
GravityLevel[id] > 0)
        
set_task(0.5"AddGravity"id)
}

public 
AddHealth(id)
{
    
set_user_health(idget_user_health(id) + (20*HealthLevel[id]))
    
    if(
get_user_health(id) > 100.0)
        
MaxHealth[id] = get_user_health(id)
        
    else
        
MaxHealth[id] = 100
        
    Refreshing
[id] = false
}

public 
AddGravity(id)
{
    new 
Num = (800 GravityLevel[id]*30)/800
    set_user_gravity
(id1.0 Num)
}

public 
event_curweapon(id)
{
    if(
SpeedLevel[id] > 0)
        
set_task(0.5"SetSpeed"id)
}

public 
SetSpeed(id)
{
    
set_user_maxspeed(idget_user_maxspeed(id) +(20*SpeedLevel[id]))    
}

public 
TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(
victim != attacker)
    {
        if(
DamageLevel[attacker] > 0)
        {
            
SetHamParamFloat(4damage * (1.0 + (DamageLevel[attacker] * 0.2)))
        }
    }
}

public 
NeverEndingRegen()
{
    new 
players[32], num
    get_players
(playersnum"ach")
    
    for(new 
id;id num;id++)
    {
        new 
players[id]
        if(
RegenLevel[i] > && !Refreshing[id])
        {
            if((
get_user_health(i) + RegenLevel[i]) > MaxHealth[i]) set_user_health(iMaxHealth[i])
            else 
set_user_health(iget_user_health(i) + RegenLevel[i])
        }
    }
}

public 
CMD_Prestige(id)
{
    new 
Format[100], StrFloat[4]
    
    
formatex(Formatcharsmax(Format), "Powers: [Prestiges: %i ( Total: %i )]"get_user_prestige(id), get_user_ever_prestige(id))
    
    new 
PrestigeMenu menu_create(Format"HandleCMD_Prestige")
    
    
float_to_str(250.0 + (20*(SpeedLevel[id]+1)), StrFloatcharsmax(StrFloat))
    
    
formatex(Formatcharsmax(Format), "%sSpeed \d[\yLevel %i\d][\r%s units\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(SpeedLevel[id]) ? "\w" "\d"SpeedLevel[id], StrFloatPrice(SpeedLevel[id]), Price(SpeedLevel[id]) == "" "s"SpeedLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
formatex(Formatcharsmax(Format), "%sHealth \d[\yLevel %i\d][\r+%i health\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(HealthLevel[id]) ? "\w" "\d"HealthLevel[id], (HealthLevel[id]+1)*20Price(HealthLevel[id]), Price(HealthLevel[id]) == "" "s"HealthLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
float_to_str(1.0 + (0.2*(DamageLevel[id]+1)), StrFloatcharsmax(StrFloat))
    
formatex(Formatcharsmax(Format), "%sDamage \d[\yLevel %i\d][\r%sx\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(DamageLevel[id]) ? "\w" "\d"DamageLevel[id], StrFloatPrice(DamageLevel[id]), Price(DamageLevel[id]) == "" "s"DamageLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
float_to_str((800.0 GravityLevel[id]*30)/800StrFloatcharsmax(StrFloat))
    
formatex(Formatcharsmax(Format), "%sGravity \d[\yLevel %i\d][\r%s Gravity\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(GravityLevel[id]) ? "\w" "\d"GravityLevel[id], 800-(30*GravityLevel[id]), Price(GravityLevel[id]), Price(GravityLevel[id]) == "" "s"GravityLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
formatex(Formatcharsmax(Format), "%sHP Regeneration \d[\yLevel %i\d][\r%i HP/Sec\d] - %i Prestige%s%s"get_user_prestige(id) >= Price(RegenLevel[id]) ? "\w" "\d"RegenLevel[id], RegenLevel[id], Price(RegenLevel[id]), Price(RegenLevel[id]) == "" "s"RegenLevel[id] < MAX_LEVEL-"" "\d[\rMAXED\d]" )
    
menu_additem(PrestigeMenuFormat)
    
    
formatex(Formatcharsmax(Format), "Reset Powers \d[\rFree\d]")
    
menu_additem(PrestigeMenuFormat)
    
    
menu_display(idPrestigeMenu)

}

public 
HandleCMD_Prestige(idPrestigeMenuitem)
{
    if(
item == MENU_EXIT) return;
    
    switch(
item+1)
    {    
        case 
1:
        {
            if(
get_user_prestige(id) >= Price(SpeedLevel[id]) && SpeedLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(SpeedLevel[id]))
                
SpeedLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Speed Upgrade!")
            }
        }
        
        case 
2:
        {    
            if(
get_user_prestige(id) >= Price(HealthLevel[id]) && HealthLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(HealthLevel[id]))
                
HealthLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Health Upgrade!")
            }
        }
        
        case 
3:
        {
            if(
get_user_prestige(id) >= Price(DamageLevel[id]) && DamageLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(DamageLevel[id]))
                
DamageLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Health Upgrade!")
            }
        }
        
        case 
4:
        {
            if(
get_user_prestige(id) >= Price(GravityLevel[id]) && GravityLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(GravityLevel[id]))
                
GravityLevel[id]++;
                
ColorChat(id"^4Congratulations on buying Gravity Upgrade!")
            }
        }
        
        case 
5:
        {
            if(
get_user_prestige(id) >= Price(RegenLevel[id]) && RegenLevel[id] < MAX_LEVEL-1)
            {
                
set_user_prestige(idget_user_prestige(id) - Price(RegenLevel[id]))
                
RegenLevel[id]++;
                
ColorChat(id"^4Congratulations on buying HP Regeneration Upgrade!")
            }
        }
        case 
PowerNum+1:
        {
            
HealthLevel[id] = 0
            SpeedLevel
[id] = 0
            DamageLevel
[id] = 0
            GravityLevel
[id] = 0
            RegenLevel
[id] = 0
            set_user_prestige
(idget_user_ever_prestige(id))
            
ColorChat(id"^4You have successfuly reset your powers!")
        }
    }
    if(
item != MENU_EXIT)
    {
        
CMD_Prestige(id)
        
SavePowers(id)
    }
    
}

SavePowers(id)

    new 
szAuth[33];
    new 
szKey[64];

    if ( 
get_user_save_method(id) == 0)
    {
        
get_user_ipidszAuth charsmax(szAuth), 1);
        
formatexszKey 63 "%s-IP" szAuth);
    }
    else if ( 
get_user_save_method(id) == )
    {
        
get_user_authidid szAuth charsmax(szAuth) );
        
formatexszKey 63 "%s-ID" szAuth);
    }
    
    new 
szData[256];
    
    
formatex(szData255"%i#%i#%i#%i#%i#"SpeedLevel[id], HealthLevel[id], DamageLevel[id], GravityLevel[id], RegenLevel[id])
        
    
nvault_setPrestigeVault szKey szData );
}

LoadPowers(id)
{
    new 
szAuth[33];
    new 
szKey[40], szKey2[40];
    new 
BestBest2
    
// Best save is loaded
    
get_user_ipidszAuth charsmax(szAuth), 1);
    
formatexszKey 63 "%s-IP" szAuth);
    
    
get_user_authidid szAuth charsmax(szAuth) );
    
formatexszKey2 63 "%s-ID" szAuth);
    
    new 
szData[256], szData2[256];

    
formatex(szData255"%i#%i#%i#%i#%i#"SpeedLevel[id], HealthLevel[id], DamageLevel[id], GravityLevel[id], RegenLevel[id]) 
    
formatex(szData2255"%i#%i#%i#%i#%i#"SpeedLevel[id], HealthLevel[id], DamageLevel[id], GravityLevel[id], RegenLevel[id]) 
        
    
nvault_get(PrestigeVaultszKeyszData255)
    
replace_all(szData 255"#"" ")
    
    
nvault_get(PrestigeVaultszKey2szData2255)
    
replace_all(szData2 255"#"" ")
    
    new 
speed[32], health[32], damage[32], gravity[32], regen[32], speed2[32], health2[32], damage2[32], gravity2[32], regen2[32]
    
parse(szDataspeed31health31damage31gravity31regen31)
    
parse(szData2speed231health231damage231gravity231regen231)
    
    
Best str_to_num(speed) + str_to_num(health) + str_to_num(damage) + str_to_num(gravity) + str_to_num(regen)
    
Best2 str_to_num(speed2) + str_to_num(health2) + str_to_num(damage2) + str_to_num(gravity2) + str_to_num(regen2)
    
    if(
Best Best2)
    {
        
SpeedLevel[id] = str_to_num(speed)
        
HealthLevel[id] = str_to_num(health)
        
DamageLevel[id] = str_to_num(damage)
        
GravityLevel[id] = str_to_num(gravity)
        
RegenLevel[id] = str_to_num(regen)
    }
    else
    {
        
SpeedLevel[id] = str_to_num(speed2)
        
HealthLevel[id] = str_to_num(health2)
        
DamageLevel[id] = str_to_num(damage2)
        
GravityLevel[id] = str_to_num(gravity2)
        
RegenLevel[id] = str_to_num(regen2)
    }
}

stock Price(LevelAmount)
{
    new 
Value 1
    Value 
Value + (LevelAmount*2)
    
    return 
Value
}

stock ColorChat(const index, const string[], {FloatSqlResul,_}:...) 
{
    new 
msg[191], players[32], count 1Prefix[32];
    
get_cvar_string("amx_prefix_cvar"Prefix31);
    
    static 
len;
    
len formatex(msgcharsmax(msg), "^4[ %s ]^1 "Prefix);
    
vformat(msg[len], charsmax(msg) - lenstring3);
    
replace_all(msg,190,"/g","^4");// green txt
    
replace_all(msg,190,"/y","^1");// orange txt
    
replace_all(msg,190,"/ctr","^3");// team txt
    
replace_all(msg,190,"/w","^0");// team txt
    
    
if(index)    players[0] = index;
    else    
get_players(players,count,"ch");
    
    for (new 
0counti++)
    {
        if(
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"),_players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
    }

i wonder why this emoji : ?

Quote:
Originally Posted by D3XT3R View Post
gunxpmod powers and an oldest version in world )))) since 2011-2012
yes he are old and im going to modify it , and if you dont want help . leave this thread plz

Last edited by Mr.J; 01-03-2018 at 11:49.
Mr.J is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-03-2018 , 12:41   Re: Need help for powers code
Reply With Quote #17

Quote:
Originally Posted by Mr.J View Post
i wonder why this emoji : ?



yes he are old and im going to modify it , and if you dont want help . leave this thread plz
ok i will maked it compatible with ur zombie mod so could you give me ur zombie mod natives? as get user class hp or something
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 01-03-2018 , 12:48   Re: Need help for powers code
Reply With Quote #18

So you are using zombie gunxp mod, anywho you are not getting the maxhealth probably or not at a good timing unless AddHealth function is hooked at player spawns
__________________
@Jailbreak MOD [Alot of features + API] 100% done !
@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
Mr.J
Senior Member
Join Date: Sep 2017
Location: cs_assault
Old 01-03-2018 , 13:28   Re: Need help for powers code
Reply With Quote #19

Quote:
Originally Posted by D3XT3R View Post
ok i will maked it compatible with ur zombie mod so could you give me ur zombie mod natives? as get user class hp or something
im using umbrella swarm 2.0 of TbagT (and i modify it) , the code does not have natives

Quote:
Originally Posted by Natsheh View Post
So you are using zombie gunxp mod, anywho you are not getting the maxhealth probably or not at a good timing unless AddHealth function is hooked at player spawns
PHP Code:
public AddHealth(id)
{
    
set_user_health(idget_user_health(id) + (20*HealthLevel[id]));
    
    if(
get_user_health(id) > 100.0)
        
MaxHealth[id] = get_user_health(id);
        
    else
        
MaxHealth[id] = 100;
        
    
Refreshing[id] = false;
}

public 
AddGravity(id)
{
    new 
Float:Num = (800.0 GravityLevel[id]*30)/800;
    
set_user_gravity(idNum);
}

public 
event_curweapon(id)
{
    if(
SpeedLevel[id] > 0)
        
set_task(0.5"SetSpeed"id);
}

public 
SetSpeed(id)
{
    
set_user_maxspeed(idget_user_maxspeed(id) +(20*SpeedLevel[id]));
}

public 
TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(
victim != attacker)
        if(
DamageLevel[attacker] > 0)
            
SetHamParamFloat(4damage * (1.0 + (DamageLevel[attacker] * 0.2)));
}

public 
Killed(victiminflictorattacker)
{
    new 
Chance random_num(0100);
    
    if(
RespawnLevel[victim]*>= Chance && !GameOver(get_user_team(victim) == "TERRORIST" "CT"))
    {
        
set_task(2.5"Revive"victim);
        
ColorChat(victim"^4You revived at a chance of %i Percents!"RespawnLevel[victim]*5);
    }
}

public 
Revive(id)
{
    
ExecuteHamB(Ham_CS_RoundRespawnid);
}

public 
NeverEndingRegen()
{
    new 
players[32], num;
    
get_players(playersnum"ach");
    
    for(new 
id;id num;id++)
    {
        new 
players[id];
        if(
RegenLevel[i] > && !Refreshing[id])
        {
            if((
get_user_health(i) + RegenLevel[i]) > MaxHealth[i]) set_user_health(iMaxHealth[i]);
            else 
set_user_health(iget_user_health(i) + RegenLevel[i]);
        }
    }

here are all of the powers code maybe this will help
Mr.J is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-03-2018 , 16:16   Re: Need help for powers code
Reply With Quote #20

Quote:
Originally Posted by Mr.J View Post
im using umbrella swarm 2.0 of TbagT (and i modify it) , the code does not have natives



PHP Code:
public AddHealth(id)
{
    
set_user_health(idget_user_health(id) + (20*HealthLevel[id]));
    
    if(
get_user_health(id) > 100.0)
        
MaxHealth[id] = get_user_health(id);
        
    else
        
MaxHealth[id] = 100;
        
    
Refreshing[id] = false;
}

public 
AddGravity(id)
{
    new 
Float:Num = (800.0 GravityLevel[id]*30)/800;
    
set_user_gravity(idNum);
}

public 
event_curweapon(id)
{
    if(
SpeedLevel[id] > 0)
        
set_task(0.5"SetSpeed"id);
}

public 
SetSpeed(id)
{
    
set_user_maxspeed(idget_user_maxspeed(id) +(20*SpeedLevel[id]));
}

public 
TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(
victim != attacker)
        if(
DamageLevel[attacker] > 0)
            
SetHamParamFloat(4damage * (1.0 + (DamageLevel[attacker] * 0.2)));
}

public 
Killed(victiminflictorattacker)
{
    new 
Chance random_num(0100);
    
    if(
RespawnLevel[victim]*>= Chance && !GameOver(get_user_team(victim) == "TERRORIST" "CT"))
    {
        
set_task(2.5"Revive"victim);
        
ColorChat(victim"^4You revived at a chance of %i Percents!"RespawnLevel[victim]*5);
    }
}

public 
Revive(id)
{
    
ExecuteHamB(Ham_CS_RoundRespawnid);
}

public 
NeverEndingRegen()
{
    new 
players[32], num;
    
get_players(playersnum"ach");
    
    for(new 
id;id num;id++)
    {
        new 
players[id];
        if(
RegenLevel[i] > && !Refreshing[id])
        {
            if((
get_user_health(i) + RegenLevel[i]) > MaxHealth[i]) set_user_health(iMaxHealth[i]);
            else 
set_user_health(iget_user_health(i) + RegenLevel[i]);
        }
    }

here are all of the powers code maybe this will help
ithis not the full code and i already posted the full one and also for umbrella swarm game mod you should make the reg hp power work for CT Only as in my servers
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Reply


Thread Tools
Display Modes

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 18:52.


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