Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 01-01-2021 , 07:13   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #571

IDK if I edit it correctly:

PHP Code:
*================================================================================
    
    ----------------------------
    -*- [
ZEHUD Information -*-
    ----------------------------
    
    
This plugin is part of Zombie Escape Mod and is distributed under the
    terms of the GNU General 
Public LicenseCheck ZP_ReadMe.txt for details.
    
================================================================================*/


#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <crxranks>
#include <zp50_class_human>
#include <zp50_class_zombie>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
#define LIBRARY_AMMOPACKS "zp50_ammopacks"
#include <zp50_ammopacks>

new PlayerRank[33]

new const 
rankNames[20][] =
{
    
"Noob",
    
"Starter",  
    
"Killer",
    
"Pro",
    
"Swat",  
    
"Hitman",
    
"Spy"
    
"Savage",  
    
"Devil",
    
"Guardian"
    
"Headtaker",  
    
"Dragon",
    
"Skyfall"
    
"Rocketman",  
    
"Monster",
    
"Dominator",
    
"Demon Slayer",  
    
"Legendary",
    
"Savage",
    
"GodLike"
}
new const 
packNames[20] =
{
    
0,
    
100,  
    
200,
    
300,
    
400,  
    
500,
    
600
    
700,  
    
800,
    
900
    
1000,
    
1100,
    
1500,
    
2000,
    
5000,
    
10000,
    
20000,
    
50000,
    
10000,
    
9999999
}



const 
Float:HUD_SPECT_X 0.6
const Float:HUD_SPECT_Y 0.8
const Float:HUD_STATS_X 0.02
const Float:HUD_STATS_Y 0.9

const HUD_STATS_ZOMBIE_R 200
const HUD_STATS_ZOMBIE_G 250
const HUD_STATS_ZOMBIE_B 0

const HUD_STATS_HUMAN_R 0
const HUD_STATS_HUMAN_G 200
const HUD_STATS_HUMAN_B 250

const HUD_STATS_SPEC_R 255
const HUD_STATS_SPEC_G 255
const HUD_STATS_SPEC_B 255

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
new g_iUserFPS[32+1];
const 
PEV_SPEC_TARGET pev_iuser2
#define MAX_PLAYERS    32
new g_MsgSync

public plugin_init()
{
    
register_plugin("[ZP] HUD Information"ZP_VERSION_STRING"ZP Dev Team")
    
register_forward(FM_CmdStart"fw_CmdStart");    
    
g_MsgSync CreateHudSyncObj()
}

public 
plugin_natives()
{
    
set_module_filter("module_filter")
    
set_native_filter("native_filter")
}
public 
module_filter(const module[])
{
    if (
equal(moduleLIBRARY_NEMESIS) || equal(moduleLIBRARY_SURVIVOR) || equal(moduleLIBRARY_AMMOPACKS))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}
public 
native_filter(const name[], indextrap)
{
    if (!
trap)
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
client_putinserver(id)
{
    if (!
is_user_bot(id))
    {
        
// Set the custom HUD display task
        
set_task(1.0"ShowHUD"id+TASK_SHOWHUD__"b")
    }
}

public 
client_disconnect(id)
{
    
remove_task(id+TASK_SHOWHUD)
}
public 
fw_CmdStart(iduc_handle)
{
    
// Get player's FPS accurately
    
g_iUserFPS[id] = floatround(/ (get_uc(uc_handleUC_Msec) * 0.001));
}
// Show HUD Task
public ShowHUD(taskid)
{
    new 
player ID_SHOWHUD


    
new currentPlayerRank 0;  
    while(
currentPlayerRank < (20 1)) 
    {        
        if(
zp_ammopacks_get(player) >= packNames[currentPlayerRank 1])         
        ++
currentPlayerRank;     
        else      
        break ;
    }  
    
PlayerRank[player] = currentPlayerRank;      

    
// Player dead?
    
if (!is_user_alive(player))
    {
        
// Get spectating target
        
player pev(playerPEV_SPEC_TARGET)
        
        
// Target not alive
        
if (!is_user_alive(player))
            return;
    }
    
    
// Format classname
    
static class_name[32], transkey[64]
    new 
redgreenblue
    
    
if (zp_core_is_zombie(player)) // zombies
    
{
        
red HUD_STATS_ZOMBIE_R
        green 
HUD_STATS_ZOMBIE_G
        blue 
HUD_STATS_ZOMBIE_B
        
        
// Nemesis Class loaded?
        
if (LibraryExists(LIBRARY_NEMESISLibType_Library) && zp_class_nemesis_get(player))
            
formatex(class_namecharsmax(class_name), "%L"ID_SHOWHUD"CLASS_NEMESIS")
        else
        {
            
zp_class_zombie_get_name(zp_class_zombie_get_current(player), class_namecharsmax(class_name))
            
            
// ML support for class name
            
formatex(transkeycharsmax(transkey), "ZOMBIENAME %s"class_name)
            if (
GetLangTransKey(transkey) != TransKey_Badformatex(class_namecharsmax(class_name), "%L"ID_SHOWHUDtranskey)
        }
    }
    else 
// humans
    
{
        
red HUD_STATS_HUMAN_R
        green 
HUD_STATS_HUMAN_G
        blue 
HUD_STATS_HUMAN_B
        
        
// Survivor Class loaded?
        
if (LibraryExists(LIBRARY_SURVIVORLibType_Library) && zp_class_survivor_get(player))
            
formatex(class_namecharsmax(class_name), "%L"ID_SHOWHUD"CLASS_SURVIVOR")                     
        else
        {
            
zp_class_human_get_name(zp_class_human_get_current(player), class_namecharsmax(class_name))
            
            
// ML support for class name
            
formatex(transkeycharsmax(transkey), "HUMANNAME %s"class_name)
            if (
GetLangTransKey(transkey) != TransKey_Badformatex(class_namecharsmax(class_name), "%L"ID_SHOWHUDtranskey)
        }
    }
    
    
// Spectating someone else?
    
if (player != ID_SHOWHUD)
    {
        new 
player_name[32]
        
get_user_name(playerplayer_namecharsmax(player_name))
        
        
// Show name, health, class, and money
        
set_hudmessage(HUD_STATS_SPEC_RHUD_STATS_SPEC_GHUD_STATS_SPEC_BHUD_SPECT_XHUD_SPECT_Y06.01.10.00.0, -1)
        
        if (
LibraryExists(LIBRARY_AMMOPACKSLibType_Library))
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"%L: %s^nHP: %d - %L %s - %L %d - FPS: %d^n Level: %i - XP: %i/%i"ID_SHOWHUD"SPECTATING"player_nameget_user_health(player), ID_SHOWHUD"CLASS_CLASS"class_nameID_SHOWHUD"AMMO_PACKS1"zp_ammopacks_get(player), g_iUserFPS[player], crxranks_get_user_level(), crxranks_get_user_xp(), crxranks_get_user_next_xp())
        else
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"%L: %s^nHP: %d - %L %s - %L $ %d - FPS: %d^n Level: %i - XP: %i/%i"ID_SHOWHUD"SPECTATING"player_nameget_user_health(player), ID_SHOWHUD"CLASS_CLASS"class_nameID_SHOWHUD"MONEY1"cs_get_user_money(player), g_iUserFPS[player], crxranks_get_user_level(), crxranks_get_user_xp(), crxranks_get_user_next_xp())
    else
    {
        
// Show health, class
        
set_hudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0, -1)
        
        if (
LibraryExists(LIBRARY_AMMOPACKSLibType_Library))
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"HP: %d - %L %s - %L %d - %s^nFPS: %d^n Level: %i - XP: %i/%i"get_user_health(ID_SHOWHUD), ID_SHOWHUD"CLASS_CLASS"class_nameID_SHOWHUD"AMMO_PACKS1"zp_ammopacks_get(ID_SHOWHUD), rankNames[currentPlayerRank], g_iUserFPS[player], crxranks_get_user_level(), crxranks_get_user_xp(), crxranks_get_user_next_xp())
            
        else
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"HP: %d - %L %s - %s^nFPS: %d^n Level: %i - XP: %i/%i"get_user_health(ID_SHOWHUD), ID_SHOWHUD"CLASS_CLASS"class_namerankNames[currentPlayerRank], g_iUserFPS[player], crxranks_get_user_level(), crxranks_get_user_xp(), crxranks_get_user_next_xp())
    }

Errors:
PHP Code:
//// ze_hud_info.sma
//
// C:\Users\Aesthetic\Desktop\test\addons\amxmodx\scripting\zp50\ze_hud_info.sma(139) : warning 233: symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead.
//
// C:\Users\Aesthetic\addons\amxmodx\scripting\zp50\ze_hud_info.sma(225) : error 088: number of arguments does not match definition
// C:\Users\Aesthetict\addons\amxmodx\scripting\zp50\ze_hud_info.sma(227) : error 088: number of arguments does not match definition
// C:\Users\Aesthetic\addons\amxmodx\scripting\zp50\ze_hud_info.sma(228) : warning 217: loose indentation
// C:\Users\Aesthetic\addons\amxmodx\scripting\zp50\ze_hud_info.sma(228) : error 029: invalid expression, assumed zero
// C:\Users\Aesthetic\addons\amxmodx\scripting\zp50\ze_hud_info.sma(234) : error 088: number of arguments does not match definition
// C:\Users\test\addons\amxmodx\scripting\zp50\ze_hud_info.sma(237) : error 088: number of arguments does not match definition
// C:\Users\test\addons\amxmodx\scripting\zp50\ze_hud_info.sma(239) : error 030: compound statement not closed at the end of file
// 
__________________
nG_getwreck is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-01-2021 , 08:55   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #572

Of course you didn't. Where is the "player" argument like it's done with all other things in the same line? How would the plugin know which player to get XP from? Follow those examples.
__________________

Last edited by OciXCrom; 01-01-2021 at 08:55.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 01-01-2021 , 10:49   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #573

Quote:
Originally Posted by OciXCrom View Post
Of course you didn't. Where is the "player" argument like it's done with all other things in the same line? How would the plugin know which player to get XP from? Follow those examples.
I forgot lol
__________________
nG_getwreck is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 01-03-2021 , 20:52   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #574

W.I.P addon system.

__________________
GitHub
SteamWishlist

六四天安門事件

Last edited by +ARUKARI-; 01-03-2021 at 21:19.
+ARUKARI- is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 01-05-2021 , 00:03   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #575

Quote:
Originally Posted by OciXCrom View Post
Of course you didn't. Where is the "player" argument like it's done with all other things in the same line? How would the plugin know which player to get XP from? Follow those examples.
In "load" function you use non threaded sql request please fix this error. 1252 line
karaulov is offline
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 01-07-2021 , 12:43   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #576

I want to add level for zombie classes is it possible?

Plugin:
Attached Files
File Type: sma Get Plugin or Get Source (ze_class_zombie_rage.sma - 90 views - 2.9 KB)
__________________

Last edited by nG_getwreck; 01-07-2021 at 12:44.
nG_getwreck is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-07-2021 , 13:49   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #577

Quote:
Originally Posted by nG_getwreck View Post
I want to add level for zombie classes is it possible?

Plugin:
Add this in the plugin:

Code:
#include <crxranks>
const zombieclass_unlock_level = 15
public zp_fw_class_zombie_select_pre(id, iClass) {
    if(iClass == g_ZombieClassID)
    {         if(crxranks_get_user_level(id) < zombieclass_unlock_level)         {             return ZP_CLASS_NOT_AVAILABLE         }     }     return ZP_CLASS_AVAILABLE }

The highlighted lines are the ones you need to modify if you want to use it in a different plugin.
You only need to change the "g_ZombieClassID" variable to the one the plugin uses, if it's different.
And set the level in the second line.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-12-2021 , 18:02   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #578

can you add $knife$ to the hud so we can get the knife name that player using through it.
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-12-2021 , 21:36   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #579

Quote:
Originally Posted by husam124 View Post
can you add $knife$ to the hud so we can get the knife name that player using through it.
What knife?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-13-2021 , 01:16   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #580

Quote:
Originally Posted by OciXCrom View Post
What knife?
i mean if i want to put knife: (knife name) in hud i need to define too much things and create new hud.
but if you define knife name as $knife$ it would be easier
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
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 17:46.


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