Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » get_player_name(poker)
get_player_name(poker) [message #204109] Fri, 16 June 2006 06:27 Go to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
Hi guys,

im using a poke script, but i want to get the name of the person who 'poked' it. I've tried get_player_name(poker) but it only gets the ID not the name. Any ideas of what i can do?

Thanks buffymaniack
Re: get_player_name(poker) [message #204202 is a reply to message #204109] Fri, 16 June 2006 20:06 Go to previous messageGo to next message
ghost is currently offline  ghost
Messages: 437
Registered: May 2005
Location: California
Karma: 0
Commander
This script would be very usefull Smile

http://img287.imageshack.us/img287/9936/davesigea4rw5.png
Please visit my forums at: RenForce
Creator of the CrazyAOW Mod
Re: get_player_name(poker) [message #204206 is a reply to message #204109] Fri, 16 June 2006 20:53 Go to previous messageGo to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
can't you just get name from that id? -_-

do the poked thing and get the obj, then...

Get_Player_Name_by_ID(Get_ID(obj));


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Re: get_player_name(poker) [message #204211 is a reply to message #204109] Fri, 16 June 2006 21:19 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
Get_Player_Name(poker) is the correct way to get their name, ive used it before and it works fine.

Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
Re: get_player_name(poker) [message #204230 is a reply to message #204109] Sat, 17 June 2006 05:11 Go to previous messageGo to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
When i use get_player_name(poker) all it gets is 66328212 this doesnt look like a player id to me? is it the object id or something? and how do i get the players name?

Thanks buffymanaick
Re: get_player_name(poker) [message #204946 is a reply to message #204109] Thu, 22 June 2006 13:00 Go to previous messageGo to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
*bump*

jonwill any ideas?
Re: get_player_name(poker) [message #204956 is a reply to message #204109] Thu, 22 June 2006 14:13 Go to previous messageGo to next message
Cat998
Messages: 1081
Registered: January 2004
Location: Austria, Vienna
Karma: 0
General (1 Star)
Moderator/Captain

Learning C++ before using it would solve it Satisfied

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter then "Yes"

Programming is like sex: one mistake and you have to support it for the rest of your life

Want the best answers? Ask the best questions!

"So long, and thanks for all the fish."
Re: get_player_name(poker) [message #204958 is a reply to message #204109] Thu, 22 June 2006 14:27 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
I expect your putting the return value from the get_poker_name into an INT variable, so what you are getting is a numerical value relating to what the players name is. I can't remember what they call the text variable type in C++, but if it's the same as java it will be String

http://steamsignature.com/card/1/76561197975867233.png
Re: get_player_name(poker) [message #204962 is a reply to message #204958] Thu, 22 June 2006 14:43 Go to previous messageGo to next message
bandie63 is currently offline  bandie63
Messages: 353
Registered: November 2004
Karma: 0
Commander
danpaul88 wrote on Thu, 22 June 2006 18:27

I expect your putting the return value from the get_poker_name into an INT variable, so what you are getting is a numerical value relating to what the players name is. I can't remember what they call the text variable type in C++, but if it's the same as java it will be String



Yeah, it's string.


http://img.photobucket.com/albums/v703/Bandie63/Daniels/userbar1.jpg
Re: get_player_name(poker) [message #204964 is a reply to message #204109] Thu, 22 June 2006 15:05 Go to previous messageGo to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
for your information i do know some c++ and am actually in the process of improving my knowledge right now, i have a book you see lol! and you were right a stupid programmers error, wrong variable type.
Re: get_player_name(poker) [message #204965 is a reply to message #204109] Thu, 22 June 2006 15:11 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
glad to have helped, thankfully PHP does not particually care what the variable types are, so I only get those problems when doing Java code, which I don't do half of much of as I do PHP code... Rocked Over

http://steamsignature.com/card/1/76561197975867233.png
Re: get_player_name(poker) [message #205017 is a reply to message #204109] Fri, 23 June 2006 00:40 Go to previous messageGo to next message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma: 0
Colonel
char PName[255];
PName = Get_Player_Name(poker);
printf("Poked - Player Name: %s\n", PName);


That should get you the name.


Let all your wishes be granted except one, so you will still have something to strieve for.
Re: get_player_name(poker) [message #205037 is a reply to message #205017] Fri, 23 June 2006 05:10 Go to previous messageGo to next message
=HT=T-Bird is currently offline  =HT=T-Bird
Messages: 712
Registered: June 2005
Karma: 0
Colonel
dead6re wrote on Fri, 23 June 2006 02:40

char PName[255];
PName = Get_Player_Name(poker);
printf("Poked - Player Name: %s\n", PName);


That should get you the name.

Although, player names longer than 255 characters will cause that snippet of code to fail miserably (think std::string).


HTT-Bird (IRC)
HTTBird (WOL)
Proud HazTeam Lieutenant.
BlackIntel Coder & Moderator.

If you have trouble running BIATCH on your FDS, have some questions about a BIATCH message or log entry, or think that BIATCH spit out a false positive, PLEASE contact the BlackIntel coding team and avoid wasting the time of others.
Re: get_player_name(poker) [message #205055 is a reply to message #205037] Fri, 23 June 2006 09:03 Go to previous messageGo to next message
Cat998
Messages: 1081
Registered: January 2004
Location: Austria, Vienna
Karma: 0
General (1 Star)
Moderator/Captain

=HT=T-Bird wrote on Fri, 23 June 2006 14:10

dead6re wrote on Fri, 23 June 2006 02:40

char PName[255];
PName = Get_Player_Name(poker);
printf("Poked - Player Name: %s\n", PName);


That should get you the name.

Although, player names longer than 255 characters will cause that snippet of code to fail miserably (think std::string).


scripts.dll does not allow nick names longer than 35 chars.
Use printf("Poked - Player Name: %s\n", Get_Player_Name(poker));


When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter then "Yes"

Programming is like sex: one mistake and you have to support it for the rest of your life

Want the best answers? Ask the best questions!

"So long, and thanks for all the fish."
Re: get_player_name(poker) [message #205059 is a reply to message #204109] Fri, 23 June 2006 09:27 Go to previous message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma: 0
Colonel
I used the variable PName so he could understand how to store the name, although I could have just used printf and not stored the name. Just helps with his learning.

Let all your wishes be granted except one, so you will still have something to strieve for.
Previous Topic: Complete changelog for scripts.dll 2.8
Next Topic: A New Hope - Mod Tools
Goto Forum:
  


Current Time: Wed Nov 27 19:41:06 MST 2024

Total time taken to generate the page: 0.01452 seconds