Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » How do you find owner of a newly bought tank?
How do you find owner of a newly bought tank? [message #177559] Wed, 02 November 2005 18:44 Go to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
i'm just tryiny to find out the owner given the tank which has just been purchused by a player :S i just wanna know the obj, name or ID of that player... ie: how does the log know that "Player purchased a vehicle"?

- lots of thanks


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Re: How do you find owner of a newly bought tank? [message #177562 is a reply to message #177559] Wed, 02 November 2005 19:08 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
At the moment, you cant.

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: How do you find owner of a newly bought tank? [message #177564 is a reply to message #177559] Wed, 02 November 2005 19:14 Go to previous messageGo to next message
rm5248 is currently offline  rm5248
Messages: 1156
Registered: November 2003
Location: USA
Karma: 0
General (1 Star)
Though it would be useful to determine who bought a tank, so that you can kick people for GTT. (grand theft tank XD)

w00t?
Re: How do you find owner of a newly bought tank? [message #177595 is a reply to message #177564] Wed, 02 November 2005 23:06 Go to previous messageGo to next message
ghostSWT
Messages: 262
Registered: December 2003
Karma: 0
Recruit
rm5248 how are you with modifying scripts?

in ssaow 1.3.4

under
void M00_GrantPowerup_Created::Created(GameObject *obj) {

there is a
		if (Settings_ShowPlayerPurchase) {
			char PurchaseMsg[512];
			sprintf(PurchaseMsg,"%s purchased a %s",Get_Player_Name(obj),Translate_Preset(IsPlayerVehicle(obj)));
			FDSMessage(PurchaseMsg,"_PURCHASE");
		}

Now i can be wrong but I think that can be used to do what you want. You can try something like saving the Get_Player_Name(obj)and IsPlayerVehicle(obj). Then when you need to, check if they match, if they don't then that player is in someone elses tank.

Keep in mind players die, leave, and lose vehicles(death/stolen) so you would have to keep track of those things.

[Updated on: Wed, 02 November 2005 23:07]

Report message to a moderator

Re: How do you find owner of a newly bought tank? [message #177622 is a reply to message #177559] Thu, 03 November 2005 05:06 Go to previous messageGo to next message
Renardin6 is currently offline  Renardin6
Messages: 1570
Registered: December 2003
Location: Belgium
Karma: 0
General (1 Star)

theplague wrote on Wed, 02 November 2005 19:44

i'm just tryiny to find out the owner given the tank which has just been purchused by a player :S i just wanna know the obj, name or ID of that player... ie: how does the log know that "Player purchased a vehicle"?

- lots of thanks


Why do you need to know that?...
Re: How do you find owner of a newly bought tank? [message #177626 is a reply to message #177559] Thu, 03 November 2005 05:34 Go to previous messageGo to next message
mac is currently offline  mac
Messages: 1018
Registered: February 2003
Karma: 0
General (1 Star)
Administrator/General
It's not possible yet..

Quote:


danpaul88: buggy bugs brenbot because buggy befriends brainlessness

Re: How do you find owner of a newly bought tank? [message #177689 is a reply to message #177595] Thu, 03 November 2005 14:12 Go to previous messageGo to next message
rm5248 is currently offline  rm5248
Messages: 1156
Registered: November 2003
Location: USA
Karma: 0
General (1 Star)
ghostSWT wrote on Thu, 03 November 2005 00:06

rm5248 how are you with modifying scripts?


If that's C++ then I can't, but if it's Java I'd be able to do it in a few months probably, I'm taking a Java class at school...

So I've got no experience what so ever.


w00t?
Re: How do you find owner of a newly bought tank? [message #177702 is a reply to message #177559] Thu, 03 November 2005 15:11 Go to previous messageGo to next message
YSLMuffins is currently offline  YSLMuffins
Messages: 1144
Registered: February 2003
Location: Moved a long time ago (it...
Karma: 0
General (1 Star)
Moderator - Mod Forum
Seems like it would certainly be possible. Or else how does the player lock that reserves the vehicle for the first 30 seconds or so work?

-YSLMuffins
The goddess of all (bread products)
See me online as yslcheeze
Re: How do you find owner of a newly bought tank? [message #177703 is a reply to message #177559] Thu, 03 November 2005 15:12 Go to previous messageGo to next message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma: 0
Recruit
nawwww....
i tryed using the:
sprintf(PurchaseMsg,"%s purchased a %s" ,Get_Player_Name(obj),Translate_Preset(IsPlayerVehicle(obj)) );
block, no luck...

but how does brenbot do it? it shows tank buys... :S


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
Re: How do you find owner of a newly bought tank? [message #177704 is a reply to message #177689] Thu, 03 November 2005 15:12 Go to previous messageGo to next message
Cat998
Messages: 1081
Registered: January 2004
Location: Austria, Vienna
Karma: 0
General (1 Star)
Moderator/Captain

rm5248 wrote on Thu, 03 November 2005 22:12

ghostSWT wrote on Thu, 03 November 2005 00:06

rm5248 how are you with modifying scripts?


If that's C++ then I can't, but if it's Java I'd be able to do it in a few months probably, I'm taking a Java class at school...

So I've got no experience what so ever.



Yes, Renegade is made in JAVA Big Grin


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: How do you find owner of a newly bought tank? [message #177730 is a reply to message #177704] Thu, 03 November 2005 16:52 Go to previous messageGo to next message
rm5248 is currently offline  rm5248
Messages: 1156
Registered: November 2003
Location: USA
Karma: 0
General (1 Star)
Cat998 wrote on Thu, 03 November 2005 16:12

rm5248 wrote on Thu, 03 November 2005 22:12

ghostSWT wrote on Thu, 03 November 2005 00:06

rm5248 how are you with modifying scripts?


If that's C++ then I can't, but if it's Java I'd be able to do it in a few months probably, I'm taking a Java class at school...

So I've got no experience what so ever.



Yes, Renegade is made in JAVA Big Grin


Oh, really? I didn't know that. I thought that most games would be made with C++ or something...


w00t?
Re: How do you find owner of a newly bought tank? [message #178673 is a reply to message #177559] Thu, 10 November 2005 12:21 Go to previous messageGo to next message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma: 0
Colonel
Welcome to the untruely unclever way of detecting who is the owner of a new tank.

On the tanks object in object.aow you attach a script and add a void created. Then get this to go into the FDS log or DDE.

Wow, we figured how to find out what preset was created!!!
Now, remember that the FDS can tell us who purchased a vehicle?

So now,

Either
1) We find that a new preset has been created for nod or gdi so we wait to find out which team purchased that veichle because we can store which team the person is one.
2) We find that someone has purchased a new vehicle but we dont know what so we wait for the scripts.dll message and find out what preset it was.

One we have both message, we can output a nice combined string. Tad Ta!


Let all your wishes be granted except one, so you will still have something to strieve for.
Re: How do you find owner of a newly bought tank? [message #179080 is a reply to message #177559] Mon, 14 November 2005 02:55 Go to previous messageGo to next message
mac is currently offline  mac
Messages: 1018
Registered: February 2003
Karma: 0
General (1 Star)
Administrator/General
brenbot just reads it from the logfile, it doesnt say what vehicle.

You can detect that a vehicle was created by hooking the object, but you cannot say yet who the owner is, who bought it... thats something for jonwil to add


Quote:


danpaul88: buggy bugs brenbot because buggy befriends brainlessness

Re: How do you find owner of a newly bought tank? [message #179113 is a reply to message #177559] Mon, 14 November 2005 13:03 Go to previous message
Dave Mason is currently offline  Dave Mason
Messages: 2357
Registered: April 2004
Location: Shropshire, England
Karma: 0
General (2 Stars)
If you want to find out who's tank it is, get in it and see who cries.

www.myspace.com/midas
Previous Topic: Scripts detect chat?
Next Topic: Sound name
Goto Forum:
  


Current Time: Tue Sep 03 08:27:34 MST 2024

Total time taken to generate the page: 0.00909 seconds