Raised This Month: $ Target: $400
 0% 

get_user_ping error :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sage_UA
Junior Member
Join Date: Dec 2008
Old 12-21-2008 , 14:40   get_user_ping error :(
Reply With Quote #1

hi all.

Help with a code..

I write a plugin which shows the information on a connection the player. It is a lot of such plugins, but I would like the.

Here a code part in which error:
Code:
new g_msgSayText
new g_msgTeamInfo
new advert[32]

#endif 

public plugin_init()
{   
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("pifc_advert", "xxxxxxxx.ua")
    
    #if defined ANN2CHAT
    g_msgSayText = get_user_msgid("SayText")
    g_msgTeamInfo = get_user_msgid("TeamInfo") 
    #endif
}
    
public client_authorized(id)
{
    if (!is_user_bot(id))
    {
        static name[32], userip[32], steamid[32], ping[32]
        get_user_name(id, name, sizeof name -1)
        get_user_ip(id, userip, sizeof userip -1, 1)
        get_user_authid(id, steamid, 31)
        get_user_ping(id, ping, 31)
        get_cvar_string("pifc_advert", advert, 31)
        colorChat(0, CHATCOLOR_GREEN, "[SERVER] ^x03%s^x04 ^x03 [IP: %s]^x04 ^x03 [SteamID: %s]^x04 - connected.. PING: %d", name, userip, steamid, ping)
        colorChat(0, CHATCOLOR_BLUE, "[SERVER] %s", advert)
    }    
}
The compiler is written that by an error here:
Code:
get_user_authid(id, steamid, 31)
Help...

Thanks.

PS.
I am a beginner!
Sage_UA is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 12-21-2008 , 14:47   Re: get_user_ping error :(
Reply With Quote #2

/* Gets ping and loss at current time. */
native get_user_ping(index, &ping, &loss);


new ping, loss
get_user_ping(id ping, loss);
console_print(id, "You Ping: %d Yours Loss: %d", ping, loss)
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Sage_UA
Junior Member
Join Date: Dec 2008
Old 12-21-2008 , 14:56   Re: get_user_ping error :(
Reply With Quote #3

Code:
new ping

#endif 

public plugin_init()
{   
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("pifc_advert", "www.site.net")
    
    #if defined ANN2CHAT
    g_msgSayText = get_user_msgid("SayText")
    g_msgTeamInfo = get_user_msgid("TeamInfo") 
    #endif
}
    
public client_authorized(id)
{
    if (!is_user_bot(id))
    {
        static name[32], userip[32], steamid[32]
        get_user_name(id, name, sizeof name -1)
        get_user_ip(id, userip, sizeof userip -1, 1)
        get_user_authid(id, steamid, 31)
        get_user_ping(id, ping)
        get_cvar_string("pifc_advert", advert, 31)
        colorChat(0, CHATCOLOR_GREEN, "[SERVER] ^x03%s^x04 ^x03 [IP: %s]^x04 ^x03 [SteamID: %s]^x04 - connected.. PING: %d", name, userip, steamid, ping)
        colorChat(0, CHATCOLOR_BLUE, "[SERVER] %s", advert)
    }    
}
1 - does not compile (Error on the same line)
2 - That such "loss"?

Last edited by Sage_UA; 12-21-2008 at 16:58.
Sage_UA is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 12-21-2008 , 15:57   Re: get_user_ping error :(
Reply With Quote #4

static name[32], userip[32], steamid[32], ping, loss
get_user_name(id, name, sizeof name -1)
get_user_ip(id, userip, sizeof userip -1, 1)
get_user_authid(id, steamid, 31)
get_user_ping(id, ping, loss)
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Sage_UA
Junior Member
Join Date: Dec 2008
Old 12-21-2008 , 16:57   Re: get_user_ping error :(
Reply With Quote #5

Thanks! + karma
Sage_UA 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 09:05.


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