AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_user_ping error :( (https://forums.alliedmods.net/showthread.php?t=82341)

Sage_UA 12-21-2008 14:40

get_user_ping error :(
 
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!

AntiBots 12-21-2008 14:47

Re: get_user_ping error :(
 
/* 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)

Sage_UA 12-21-2008 14:56

Re: get_user_ping error :(
 
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"?

AntiBots 12-21-2008 15:57

Re: get_user_ping error :(
 
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)

Sage_UA 12-21-2008 16:57

Re: get_user_ping error :(
 
Thanks! + karma


All times are GMT -4. The time now is 09:05.

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