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

Rank display before changeLevel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-08-2019 , 14:19   Rank display before changeLevel
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>

public pulgin_init()
{
register_plugin(Rank on ChangeLevel)
}
register_clcmd("say /rank""cmdRank"0"- display your rank (chat)")
}
Event_InterMission();
{
client_cmd(0,"cmdRank")

Hello I am by no means a coder but I'm trying to Frankenstein this together.

My goal is for all the players to see their rank before the map changes. On my server before the map changes the scoreboard shows up for a few seconds and then the map changes. I would like this global chat command /rank invoked on the client side between these events.

FYI: I am running gameME stats

https://github.com/gamemedev/plugin-...me_cstrike.sma

Last edited by iclassdon; 12-08-2019 at 17:17.
iclassdon is offline
Send a message via MSN to iclassdon
ZaX
Senior Member
Join Date: Jan 2015
Old 12-08-2019 , 15:12   Re: Rank display before changeLevel
Reply With Quote #2

open statsx.sma

search for eventIntermission

replace it with

PHP Code:
public eventIntermission()
{
    if (
EndPlayer || EndTop15)
        
set_task(1.0"end_game_stats"900)
    
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)

    for(new 
id 0id iNumid++)
    {
        new 
izStats[8], izBody[8]
        new 
iRankPosiRankMax
        
new Float:fEffFloat:fAcc
    
        iRankPos 
get_user_stats(idizStatsizBody)
        
iRankMax get_statsnum()
    
        
fEff effec(izStats)
        
fAcc accuracy(izStats)
        
client_print(idprint_chat"* %L"id"YOUR_RANK_IS"iRankPosiRankMaxizStats[STATS_KILLS], izStats[STATS_HITS], fEfffAcc)
    }


Last edited by ZaX; 12-08-2019 at 15:13.
ZaX is offline
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-08-2019 , 17:16   Re: Rank display before changeLevel
Reply With Quote #3

Hey Zax, thanks for the reply. I am not using statsx for rank. I am running gameME stats

https://github.com/gamemedev/plugin-...me_cstrike.sma

The only way I think possible to make it work is to invoke that client_cmd. Unless something in the gameME code can be altered to produce the usage of /rank as described in my first post.
iclassdon is offline
Send a message via MSN to iclassdon
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-08-2019 , 19:19   Re: Rank display before changeLevel
Reply With Quote #4

Haven't looked at the code, but using "client_cmd" isn't the best option as it will have a delay. You can directly call the function that is hooked to the command using the "callfunc_*" functions.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
ZaX
Senior Member
Join Date: Jan 2015
Old 12-09-2019 , 05:41   Re: Rank display before changeLevel
Reply With Quote #5

I dont know about gameme, but in the code its blocking the rank command
ZaX is offline
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 19:29.


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