Home » Renegade Discussions » Mod Forum » Few questions
Re: Few questions [message #408903 is a reply to message #408896] |
Sat, 31 October 2009 05:56 |
Hubba
Messages: 40 Registered: October 2009
Karma:
|
Recruit |
|
|
cAmpa wrote on Sat, 31 October 2009 05:41 |
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.
|
Oops didn't notice that, Thanks cAmpa
If someones wondering it should be "Weapon_Railgun_Player" instead of "POW_Railgun_Player"
----------------------------------
Another question:
Is there a way to check if a character has a "fly suit"
My fly command looks like this:
class flyChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
Toggle_Fly_Mode(obj);
}
};
ChatCommandRegistrant<flyChatCommand> flyChatCommandReg("!fly",CHATTYPE_ALL,0,GAMEMODE_AOW);
[Updated on: Sat, 31 October 2009 05:59] Report message to a moderator
|
|
|
|
|
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 10:54:44 MST 2024
Total time taken to generate the page: 0.00840 seconds
|