Raised This Month: $ Target: $400
 0% 

Rank message fail :/


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-28-2013 , 18:04   Rank message fail :/
Reply With Quote #1

Hi
I tried use this:
PHP Code:
#include <amxmodx>
#include <csx>

#define MESSAGE_PREFIX "AMXX"

public plugin_init() {
    
register_plugin("Client Connect Rank""0.0.1""Jhob94")
}

public 
client_putinserver(id)
{
    new 
iStats[8], Rankname[32]
    
    
Rank get_user_stats(idiStatsiStats)
    
get_user_name(id,name,31)
    
    if(!
is_user_bot(id))
    {
        if(
Rank <= 15)
            
client_print(0print_chat"[%s] %s joined the server. Be careful his rank is %d !"MESSAGE_PREFIXnameRank)
    
        else
            
client_print(0print_chat"[%s] %s joined the server. His rank is %d ."MESSAGE_PREFIXnameRank)
    }

It works, but have some fail... It always says that rank is 0
Someone knows why?
__________________
Jhob94 is offline
MousePad
Junior Member
Join Date: Apr 2012
Old 04-28-2013 , 18:34   Re: Rank message fail :/
Reply With Quote #2

Did you try reading this when the player spawns? Or maybe you could try to get it a couple seconds after client_putinserver.
MousePad is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-28-2013 , 19:05   Re: Rank message fail :/
Reply With Quote #3

I dont want on spawn.
Btw maybe the problem is because on client_putinserver, it didnt set rank yet. Hum i go try set an task
__________________

Last edited by Jhob94; 04-28-2013 at 19:11.
Jhob94 is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 04-28-2013 , 19:28   Re: Rank message fail :/
Reply With Quote #4

Try replacing the following:

PHP Code:
client_putinserverid 


PHP Code:
client_authorizedid 
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-28-2013 , 19:42   Re: Rank message fail :/
Reply With Quote #5

If iam not wrong, putinserver is after authorized(not sure). Btw i tried both, not worked.
Now is working, i did made a event for team join, the only problem is that display more then one message for the same player :/
__________________

Last edited by Jhob94; 04-28-2013 at 19:43. Reason: fix
Jhob94 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-28-2013 , 19:57   Re: Rank message fail :/
Reply With Quote #6

Quote:
Originally Posted by Jhob94 View Post
If iam not wrong, putinserver is after authorized(not sure).
Not always the case, just most of the time
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
MousePad
Junior Member
Join Date: Apr 2012
Old 04-28-2013 , 19:50   Re: Rank message fail :/
Reply With Quote #7

Can you paste your final code here?
MousePad is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-28-2013 , 20:04   Re: Rank message fail :/
Reply With Quote #8

Quote:
Originally Posted by MousePad View Post
Can you paste your final code here?
PHP Code:
#include <amxmodx>
#include <csx>

#define MESSAGE_PREFIX "AMXX"

public plugin_init() {
    
register_plugin("Client Connect Rank""0.0.1""Jhob94")
    
    
register_event("TeamInfo""Join_Team""b")
}
public 
Join_Team(id
{
    new 
iStats[8], Rankname[32]
    
Rank get_user_stats(idiStatsiStats)
    
get_user_name(id,name,31)
    
    if(!
is_user_bot(id))
    {
        if(
Rank <= 15)
            
client_print(0print_chat"[%s] %s joined the server. Be careful his rank is %d !"MESSAGE_PREFIXnameRank)
            
        else
            
client_print(0print_chat"[%s] %s joined the server. His rank is %d ."MESSAGE_PREFIXnameRank)
    }

__________________
Jhob94 is offline
MousePad
Junior Member
Join Date: Apr 2012
Old 04-28-2013 , 20:13   Re: Rank message fail :/
Reply With Quote #9

As far as I know, that join team will be called when the player is connected the first time as a spectator before choosing a team. If you want a dirty fix without checking if the team is T or CT, you can create a bool array of player count, make the index false at client connect and check if the index is false before displaying the message. Then you can display the message and set the index to true.

Actually forget my dirty suggestion. This should have all the info you need:
https://forums.alliedmods.net/showpo...25&postcount=3

Last edited by MousePad; 04-28-2013 at 20:16.
MousePad is offline
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 04-29-2013 , 04:38   Re: Rank message fail :/
Reply With Quote #10

try
PHP Code:
#include <csstats> 
__________________
zi443r 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:53.


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