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

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 11-25-2011 , 11:30   Help
Reply With Quote #1

Hi!

How i get this the steamID and the name of client_disconnect for serverprint?

Look my plugin fails

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

public plugin_init() 

    
register_plugin("Client Test""1.0""krm"


public 
client_disconnect(id)
{
    new 
SteamID[32], Name[32]
    
    
get_user_authid(idSteamID31)
    
get_user_name(idName31)
    
    
set_task(5.0"ServerPrint"id)
}

public 
ServerPrint(SteamID[], Name[])
{
    
server_print("SteamID: %s"SteamID)
    
server_print("Name: %s"Name)

__________________

Last edited by kramesa; 11-25-2011 at 11:30.
kramesa is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 11-25-2011 , 11:53   Re: Help
Reply With Quote #2

Quote:
Originally Posted by kramesa View Post
Hi!

How i get this the steamID and the name of client_disconnect for serverprint?

Look my plugin fails

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

public plugin_init() 

    
register_plugin("Client Test""1.0""krm"


public 
client_disconnect(id)
{
    new 
SteamID[32], Name[32]
    
    
get_user_authid(idSteamID31)
    
get_user_name(idName31)
    
    
set_task(5.0"ServerPrint"id)
}

public 
ServerPrint(SteamID[], Name[])
{
    
server_print("SteamID: %s"SteamID)
    
server_print("Name: %s"Name)


PHP Code:
#include < amxmodx >

public client_disconnectid )
{
    new 
steam35 ], name32 ]
    
get_user_authididsteamsizeof steam )
    
get_user_nameidnamesizeof name 1)
    
    
sprintsteamname )
}

public 
sprintsteam[], name[] )
{
    
server_print("SteamID: %s"steam)
    
server_print("Name: %s"name)

your code calls ServerPrint with the paramater id with no "SteamID" or "Name".

Last edited by MyPc; 11-25-2011 at 12:07.
MyPc is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 11-27-2011 , 03:57   Re: Help
Reply With Quote #3

you can't get name and steamid on disconnect, but you may get it on connect, push to an array, and you can print it from the array on disconnect

Last edited by Nyuszy; 11-27-2011 at 03:58.
Nyuszy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-27-2011 , 14:12   Re: Help
Reply With Quote #4

Quote:
Originally Posted by kramesa View Post
Hi!

How i get this the steamID and the name of client_disconnect for serverprint?

Look my plugin fails
If you would just debug your code then you would know that the issue has something to do with the set_task().

Quote:
Originally Posted by Nyuszy View Post
you can't get name and steamid on disconnect, but you may get it on connect, push to an array, and you can print it from the array on disconnect
You are wrong. It works perfectly fine on client_disconnect(). His problem is stated above.
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-27-2011 , 16:27   Re: Help
Reply With Quote #5

You can pass steamid and name in parm argument in set_task, note that you have to specify the parms array len.
In the example i've used a pseudo-structure to make things easier and more clear.

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

enum _:mPlayersDatas
{
    
m_szName[32],
    
m_szSteamId[32]
}

public 
plugin_init() 

    
register_plugin("Client Test""1.0""krm"


public 
client_disconnect(id)
{
    new 
Datas[mPlayersDatas]
    
    
get_user_authid(idDatas[m_szSteamId], charsmax(Datas[m_szSteamId]))
    
get_user_name(idDatas[m_szName], charsmax(Datas[m_szName]))
    
    
set_task(5.0"ServerPrint"idDatassizeof(Datas))
}

public 
ServerPrint(Params[], id)
{
    
server_print("SteamID: %s"Params[m_szSteamId])
    
server_print("Name: %s"Params[m_szName])

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 14:21.


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