Home » Renegade Discussions » Mod Forum » Few questions
Re: Few questions [message #408896 is a reply to message #408894] |
Sat, 31 October 2009 04:41 |
|
cAmpa
Messages: 597 Registered: March 2006
Karma:
|
Colonel |
|
|
Hubba wrote on Sat, 31 October 2009 12:21 |
Quote: |
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
|
So what should i attach the script to? Should i create a invisible object and attach the script to it and then when everything is done it would destroy the invisible object?
--------------------------------------
Another question
How can i check if a player has a weapon?
bool Has_Weapon(GameObject *obj,const char *weapon)
I tried something like this:
if(Has_Weapon(obj,"POW_Railgun_Player")){
//Do something...
}
But it doesn't seem to work
|
You checked for a powerup, not for a weapon.
Bückstabü!
|
|
|
|
|
Few questions
By: Hubba on Thu, 29 October 2009 22:10
|
|
|
Re: Few questions
|
|
|
Re: Few questions
By: reborn on Fri, 30 October 2009 03:29
|
|
|
Re: Few questions
By: Hubba on Fri, 30 October 2009 09:22
|
|
|
Re: Few questions
By: reborn on Fri, 30 October 2009 12:48
|
|
|
Re: Few questions
By: Hubba on Fri, 30 October 2009 14:30
|
|
|
Re: Few questions
By: reborn on Fri, 30 October 2009 14:58
|
|
|
Re: Few questions
By: Hubba on Sat, 31 October 2009 04:21
|
|
|
Re: Few questions
By: cAmpa on Sat, 31 October 2009 04:41
|
|
|
Re: Few questions
By: Hubba on Sat, 31 October 2009 05:56
|
|
|
Re: Few questions
By: cAmpa on Sat, 31 October 2009 06:43
|
|
|
Re: Few questions
By: Hubba on Sat, 31 October 2009 12:10
|
|
|
Re: Few questions
By: Hubba on Thu, 05 November 2009 21:45
|
|
|
Re: Few questions
By: reborn on Thu, 05 November 2009 22:54
|
|
|
Re: Few questions
By: Hubba on Fri, 06 November 2009 09:11
|
|
|
Re: Few questions
|
|
|
Re: Few questions
By: Hubba on Fri, 06 November 2009 13:46
|
|
|
Re: Few questions
By: reborn on Sat, 07 November 2009 01:00
|
|
|
Re: Few questions
By: Hubba on Sat, 07 November 2009 03:05
|
|
|
Re: Few questions
By: raven on Sat, 07 November 2009 13:47
|
Goto Forum:
Current Time: Sun Dec 15 08:56:10 MST 2024
Total time taken to generate the page: 0.01032 seconds
|