Raised This Month: $ Target: $400
 0% 

Saving a killers auth-id to use later


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 10-10-2010 , 00:11   Saving a killers auth-id to use later
Reply With Quote #1

If I want to save a killers auth-id for use later, would I use

PHP Code:
new KillerID[33
then in the death event

PHP Code:
new AuthID[35];
get_user_authidiAttackerAuthIDcharsmax(authid) )
KillerID[iVictim] = AuthID 
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-10-2010 , 00:23   Re: Saving a killers auth-id to use later
Reply With Quote #2

No. Just use their id. The only time you would ever need their SteamID in a variable is if they leave the server and you still need their info.

Or, if you really want them then get the SteamID of everybody an client_authorized().

PHP Code:
new g_szSteamID[33][32]
// ...
get_user_authid(idg_szAuthID[id], charsmax(g_szAuthID[])) 
And, only save the id of the person so you can use the SteamID string as g_szSteamID[id_of_saved_user].
__________________

Last edited by fysiks; 10-10-2010 at 00:28.
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-10-2010 , 00:30   Re: Saving a killers auth-id to use later
Reply With Quote #3

Along with what fysiks said, what you showed would not work, because steamid(authid) is saved in string "Authid" and you cannot save that string inside of the cell of an array. Use what fysiks said.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-10-2010 , 02:18   Re: Saving a killers auth-id to use later
Reply With Quote #4

Quote:
Originally Posted by nikhilgupta345 View Post
Along with what fysiks said, what you showed would not work, because steamid(authid) is saved in string "Authid" and you cannot save that string inside of the cell of an array. Use what fysiks said.
His code would basically copy AuthID's string into KillerID.
However, it's bad code to do that.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-10-2010 , 02:21   Re: Saving a killers auth-id to use later
Reply With Quote #5

Oh yea

Got a question, what would happen to whatever part of the string is left out? Would it just not appear in the cells? Or does it loop around and go back to KillerID[0]?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-10-2010 , 02:23   Re: Saving a killers auth-id to use later
Reply With Quote #6

Since the array sizes do not match, it would result in either:
  • error saying the buffer sizes do not match
  • maybe a memory leak?
  • it would assign the values and fill up the smaller array but not even allow the null ^0 character because it treats them as arrays.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-10-2010 , 16:51   Re: Saving a killers auth-id to use later
Reply With Quote #7

You shouldn't be able to compile it. Assigning an array to a cell gives compiler error:

error 006: must be assigned to an array
__________________
fysiks 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:25.


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