Raised This Month: $32 Target: $400
 8% 

OciXCrom's Rank System [XP|Levels|Ranks]


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-10-2022 , 14:44   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #771

I already helped though.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-10-2022 , 15:48   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #772

But isn't it just that?
MeliMeli is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 05-11-2022 , 07:06   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #773

Quote:
Originally Posted by MeliMeli View Post
But isn't it just that?
Stop being annoying. You asked for support with no context and the author helped you regardless. Be grateful and move on.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-11-2022 , 20:58   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #774

Quote:
Originally Posted by DruGzOG View Post
Stop being annoying. You asked for support with no context and the author helped you regardless. Be grateful and move on.
He helped? Yes. I'm grateful, in the previous post he says "if you sleep well you'll know the rest." But anyway, I'm grateful.

Last edited by MeliMeli; 05-11-2022 at 21:26.
MeliMeli is offline
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-11-2022 , 21:13   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #775

OciXCrom, I need your help again, I'm using a zombie from ZP 4.3 to ZP 5.0, and I would like to add a level requirement to it. That if the player doesn't have enough level he won't get the zombie level, but even using what you said on page 58, it's still possible to select him. I think you need to put in the classes menu that if the player doesn't have enough level for the zombie, and the infection round starts, he will automatically change the zombie to level 0. In this case, the first zombie on the list that doesn't have any requirement

Your code:

PHP Code:
#include <crxranks>

const zombieclass_unlock_level 15

public zp_fw_class_zombie_select_pre(idiClass)
{
    if(
iClass == g_ZombieClassID)
    {
        if(
crxranks_get_user_level(id) < zombieclass_unlock_level)
        {
            return 
ZP_CLASS_NOT_AVAILABLE
        
}
    }

    return 
ZP_CLASS_AVAILABLE

Zombie Class ZP 4.3 para 5.0 (?):

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

#define PLUGIN "NST Zombie Class Heal"
#define VERSION "1.0"
#define AUTHOR "NST"

new const zclass_name[] = "Iyilesen Zombi (Heal)"
new const zclass_info[] = "[Yetenek Icin 'G']"
new const zclass_model[] = "zombie_healerl"
new const zclass_clawmodel[] = "v_knife_zombie_healer.mdl"
const zclass_health 15000
const zclass_speed 300
const Float:zclass_gravity 0.68
const Float:zclass_knockback 3.00

new idclass
new const zombie_sound_heal[] = "df_sr/zombi_heal.wav"
new const zombie_sound_healteam[] = "df_sr/td_heal.wav"

const Float:heal_timewait 10.0
const Float:heal_dmg 0.3
const heal_dmg_team 500
new idsprites_heal

new g_heal_wait[33]
new 
g_msgDamageg_msgScreenFadeg_msgSayText

new g_maxplayers
new g_roundend

enum 
(+= 100)
{
    
TASK_WAIT_HEAL 2000,
    
TASK_BOT_USE_SKILL
}

#define ID_WAIT_HEAL (taskid - TASK_WAIT_HEAL)
#define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)

public plugin_precache()
{
    
precache_sound(zombie_sound_heal)
    
precache_sound(zombie_sound_healteam)
    
    
idsprites_heal precache_model("sprites/zb_restore_health.spr")
    
    
idclass zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("DeathMsg""Death""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("drop""cmd_heal")
    
    
g_msgDamage get_user_msgid("Damage")
    
g_msgScreenFade get_user_msgid("ScreenFade")
    
g_msgSayText get_user_msgid("SayText")
    
g_maxplayers get_maxplayers()
}

public 
client_putinserver(id)
{
    
reset_value_player(id)
}

public 
client_disconnect(id)
{
    
reset_value_player(id)
}

public 
event_round_start()
{
    
g_roundend 0
    
    
for (new id=1id<=g_maxplayersid++)
    {
        if (!
is_user_connected(id)) continue;
        
        
reset_value_player(id)
    }
}

public 
logevent_round_end()
{
    
g_roundend 1
}

public 
Death()
{
    new 
victim read_data(2
    
reset_value_player(victim)
}

public 
zp_user_infected_post(id)
{
    
    
reset_value_player(id)
    
    if(
zp_get_user_nemesis(id)) return;
    
    if(
zp_get_user_zombie_class(id) == idclass)
    {
        if(
is_user_bot(id))
        {
            
set_task(random_float(5.0,15.0), "bot_use_skill"id+TASK_BOT_USE_SKILL)
            return
        }
        
        
zp_colored_print(id"^x04[ZE]^x01 Sinifinin yetenegi Iyilestirme. Yuklenme suresi %.1f saniye."heal_timewait)
    }
}

public 
zp_user_humanized_post(id)
{
    
reset_value_player(id)
}

public 
cmd_heal(id)
{
    if (
g_roundend) return PLUGIN_CONTINUE
    
    
if (!is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_nemesis(id)) return PLUGIN_CONTINUE

    
if (zp_get_user_zombie_class(id) == idclass && !g_heal_wait[id])
    {
        new 
start_health zp_get_zombie_maxhealth(id)
        if (
get_user_health(id)>=start_health) return PLUGIN_CONTINUE
        
        g_heal_wait
[id] = 1
        
        
new Float:healthFloat:heath_uphealth_set
        health 
float(get_user_health(id))
        
        
heath_up health*heal_dmg
        health_set 
floatround(health) + max(heal_dmg_teamfloatround(heath_up))
        
health_set min(start_healthhealth_set)
        
fm_set_user_health(idhealth_set)
        
        
UpdateHealthZombieTeam(id)
        
PlaySound(idzombie_sound_heal)
        
EffectRestoreHealth(id)
        
        
set_task(heal_timewait"RemoveWaitSmoke"id+TASK_WAIT_HEAL)
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}

public 
bot_use_skill(taskid)
{
    new 
id ID_BOT_USE_SKILL
    
    
if (!is_user_alive(id)) return;

    
cmd_heal(id)
    
    
set_task(random_float(5.0,15.0), "bot_use_skill"id+TASK_BOT_USE_SKILL)
}

public 
RemoveWaitSmoke(taskid)
{
    new 
id ID_WAIT_HEAL
    
    g_heal_wait
[id] = 0
    
    zp_colored_print
(id"^x04[ZE]^x01 Iyilestirme Yetenegin hazir.")
}

UpdateHealthZombieTeam(id)
{
    for (new 
1<= g_maxplayersi++)
    {
        if (!
is_user_alive(i) || zp_get_user_nemesis(i)) return;
        
        if (
zp_get_user_zombie(i) && != id)
        {
            new 
current_health get_user_health(i)
            new 
start_health zp_get_zombie_maxhealth(i)
            if (
current_health start_health)
            {
                new 
health_new
                health_new 
min(start_health, (current_health+heal_dmg_team))
                
fm_set_user_health(ihealth_new)
                
EffectRestoreHealth(i)
                
PlaySound(izombie_sound_healteam)
            }
        }
    }
}

PlaySound(id, const sound[])
{
    
client_cmd(id"spk ^"%s^""sound)
}

fm_set_user_health(idhealth)
{
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);
}

EffectRestoreHealth(id)
{
    if (!
is_user_alive(id)) return;
    
    static 
origin[3]
    
get_user_origin(idorigin)
    
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_SPRITE)
    
write_coord(origin[0])
    
write_coord(origin[1])
    
write_coord(origin[2]+30)
    
write_short(idsprites_heal)
    
write_byte(5)
    
write_byte(192)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade _id)
    
write_short(1<<10)
    
write_short(1<<10)
    
write_short(0x0000)
    
write_byte(255)
    
write_byte(0)
    
write_byte(0)
    
write_byte(75)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_id)
    
write_byte(0)
    
write_byte(0)
    
write_long(DMG_NERVEGAS)
    
write_coord(0)
    
write_coord(0)
    
write_coord(0)
    
message_end()
}

reset_value_player(id)
{
    
g_heal_wait[id] = 0
    
    remove_task
(id+TASK_WAIT_HEAL)
    
remove_task(id+TASK_BOT_USE_SKILL)
}

zp_colored_print(target, const message[], any:...)
{
    static 
buffer[512], iargscount
    argscount 
numargs()
    
    if (!
target)
    {
        static 
player
        
for (player 1player <= g_maxplayersplayer++)
        {
            if (!
is_user_connected(player))
                continue;
            
            static 
changed[5], changedcount
            changedcount 
0
            
            
for (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
            
vformat(buffercharsmax(buffer), message3)
            
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            for (
0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    else
    {
        
vformat(buffercharsmax(buffer), message3)
        
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }

I believe that a code can be placed here so that all humans who do not have enough level and select a zombie, in addition to the chat saying "You have no level for this class" after the random selection of zombies it will automatically change the zombie to class 1. (Class without requirements)

=====================
In general example [EXAMPLE]
1. Zombie Basic - Level 0
2. Zombie Advanced - Level 10

Player level: 2

He selects class 2.

Player has no level for class 2.
Infection done, class automatically changed to class 1.
Attached Files
File Type: sma Get Plugin or Get Source (zp50_class_zombie.sma - 65 views - 24.4 KB)

Last edited by MeliMeli; 05-11-2022 at 21:31.
MeliMeli is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 05-12-2022 , 21:10   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #776

I did this for myself if you want to use it

Code:
#include <amxmodx> #include <zp50_class_zombie> #include <zp50_colorchat> #include <crxranks> enum _:ClassesInfo {     szClassName[32],     iLevel,     szClassID } // Add new class like shown below // { "Class name from the original source", Level required} new g_aZombieClasses[][ClassesInfo] = {     { "Vampire Zombie", 25},     { "Assassin Zombie", 32} } public plugin_init() {     register_plugin("[ZP] Zombie Classes with levels", "0.1", "X3"); } public plugin_cfg() {     for(new i = 0; i < sizeof(g_aZombieClasses); i++) {         g_aZombieClasses[i][szClassID] = zp_class_zombie_get_id(g_aZombieClasses[i][szClassName]);     } } public zp_fw_class_zombie_select_pre(id, classid) {     if(!is_user_connected(id))         return PLUGIN_HANDLED;     new sText[32];     for(new i = 0; i < sizeof(g_aZombieClasses); i++) {         if(classid == g_aZombieClasses[i][szClassID]) {             formatex(sText, charsmax(sText), "Level : [\r%i]", g_aZombieClasses[i][iLevel]);             zp_class_zombie_menu_text_add(sText);             if(crxranks_get_user_level(id) < g_aZombieClasses[i][iLevel]) {                 return ZP_CLASS_NOT_AVAILABLE;             }         }     }     return ZP_CLASS_AVAILABLE; }
You can get zombie class name either from the plugin source, its usually defined at the top.
Or from the file zp_zombieclasses.ini
Here is an example of the zombie class name, obviously dont use the classic zombie

Last edited by ZaX; 05-12-2022 at 21:10.
ZaX is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-13-2022 , 14:07   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #777

Quote:
Originally Posted by ZaX View Post
I did this for myself if you want to use it

Code:
#include <amxmodx> #include <zp50_class_zombie> #include <zp50_colorchat> #include <crxranks> enum _:ClassesInfo {     szClassName[32],     iLevel,     szClassID } // Add new class like shown below // { "Class name from the original source", Level required} new g_aZombieClasses[][ClassesInfo] = {     { "Vampire Zombie", 25},     { "Assassin Zombie", 32} } public plugin_init() {     register_plugin("[ZP] Zombie Classes with levels", "0.1", "X3"); } public plugin_cfg() {     for(new i = 0; i < sizeof(g_aZombieClasses); i++) {         g_aZombieClasses[i][szClassID] = zp_class_zombie_get_id(g_aZombieClasses[i][szClassName]);     } } public zp_fw_class_zombie_select_pre(id, classid) {     if(!is_user_connected(id))         return PLUGIN_HANDLED;     new sText[32];     for(new i = 0; i < sizeof(g_aZombieClasses); i++) {         if(classid == g_aZombieClasses[i][szClassID]) {             formatex(sText, charsmax(sText), "Level : [\r%i]", g_aZombieClasses[i][iLevel]);             zp_class_zombie_menu_text_add(sText);             if(crxranks_get_user_level(id) < g_aZombieClasses[i][iLevel]) {                 return ZP_CLASS_NOT_AVAILABLE;             }         }     }     return ZP_CLASS_AVAILABLE; }
You can get zombie class name either from the plugin source, its usually defined at the top.
Or from the file zp_zombieclasses.ini
Here is an example of the zombie class name, obviously dont use the classic zombie
Nicely done. You could even do this without the need to edit the .sma file or have a separate .ini file. Maybe implement the required level in the class name itself and read it from there instead of an array in the .sma.

e.g. [Vampire Zombie (25)] and read the number between ( ).
__________________

Last edited by OciXCrom; 05-13-2022 at 14:07.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-13-2022 , 16:18   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #778

I just got home, thanks Zax, God bless you =D
MeliMeli is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 05-23-2022 , 01:58   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #779

@OciXCrom
Yeah that would be nice, but how can I read only numbers from a string? Is there a way to do that? Or do you have another idea how that can be done?

Edit: Oh nevermind, I just realized what you said on the last line

Last edited by ZaX; 05-23-2022 at 02:02.
ZaX is offline
wizzkidon
Senior Member
Join Date: Jan 2017
Old 05-23-2022 , 07:26   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #780

How to auto prefix with the level name on players?
Like: [Newbie]Name: Hello

To set auto prefix.


Code:
# The prefix that will be used in front of all chat messages from this plugin.

CHAT_PREFIX = &x04[CRXRanks]
Idk how it's worked.

Last edited by wizzkidon; 05-23-2022 at 07:27.
wizzkidon 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 10:09.


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