Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Having problems with Attach_Script_Once
Having problems with Attach_Script_Once [message #468584] Fri, 08 June 2012 01:43 Go to previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma:
Colonel

It say's that the first Get_Parameter is undefined.
I'm trying to set up Samsites for players to be able to buy them, and so they will attack only helis.

				char params[256];
				sprintf(params, "%d,%s,%s,%s,%s,%s,%s,%s",params,Get_Parameter("0.0"),Get_Parameter("300.0"),Get_Parameter("10.0"),Get_Parameter("CnC_GDI_Orca"),Get_Parameter("CnC_GDI_Transport"),Get_Parameter("CnC_Nod_Apache"),Get_Parameter("CnC_Nod_Transport"));
				Attach_Script_Once(nsam,"JFW_Base_Defence_Aircraft_Only",params);


here is the Sam site buy codes.
		if (wcsistr(Message,L"!gsam") == Message)
		{
			GameObject *Player = Get_GameObj(PlayerID);
			{
            float money = Commands->Get_Money(Player);
            float cost = 1000;
            if (money >= cost)
			{
			int team = Commands->Get_Player_Type(Player);
            if (team == 1)
            {
                Commands->Give_Money(Player,-1000,false);
                Vector3 pos = Commands->Get_Position(Player);
                pos.Z+=2.0f;
                GameObject *gsam = Commands->Create_Object("Nod_SAM_Site",pos);
				Commands->Set_Player_Type(gsam,0);
                Commands->Disable_Physical_Collisions(gsam);
				char params[256];
				sprintf(params, "%d,%s,%s,%s,%s,%s,%s,%s",params,Get_Parameter("0.0"),Get_Parameter("300.0"),Get_Parameter("10.0"),Get_Parameter("CnC_GDI_Orca"),Get_Parameter("CnC_GDI_Transport"),Get_Parameter("CnC_Nod_Apache"),Get_Parameter("CnC_Nod_Transport"));
				Attach_Script_Once(gsam,"JFW_Base_Defence_Aircraft_Only",params);
                char msg[250];
                sprintf(msg,"[DefBot] %s purchased a Samsite for 1000 credits.",Get_Player_Name(Player),1000);
                Send_Message_Team(1,255,255,0,msg);
                Create_2D_WAV_Sound_Team("m00evan_dsgn0002i1evan_snd.wav",1);
        }
        else
        {
                char infunds[250];
                sprintf(infunds,"[DefBot] Insufficient Funds: Samsite cost 1000 credits on this map",1000);
                Send_Message_Team(1,255,255,0,infunds);
                Create_2D_WAV_Sound_Team("m00evan_dsgn0024i1evan_snd.wav",1);
		}
			team = 1;
			}
		}
		}
		if (wcsistr(Message,L"!nsam") == Message)
		{
			GameObject *Player = Get_GameObj(PlayerID);
			{
            float money = Commands->Get_Money(Player);
            float cost = 1000;
            if (money >= cost)
			{
			int team = Commands->Get_Player_Type(Player);
            if (team == 0)
            {
                Commands->Give_Money(Player,-1000,false);
                Vector3 pos = Commands->Get_Position(Player);
                pos.Z+=2.0f;
                GameObject *nsam = Commands->Create_Object("Nod_SAM_Site",pos);
				Commands->Set_Player_Type(nsam,0);
                Commands->Disable_Physical_Collisions(nsam);
				char params[256];
				sprintf(params, "%d,%s,%s,%s,%s,%s,%s,%s",params,Get_Parameter("0.0"),Get_Parameter("300.0"),Get_Parameter("10.0"),Get_Parameter("CnC_GDI_Orca"),Get_Parameter("CnC_GDI_Transport"),Get_Parameter("CnC_Nod_Apache"),Get_Parameter("CnC_Nod_Transport"));
				Attach_Script_Once(nsam,"JFW_Base_Defence_Aircraft_Only",params);
                char msg[250];
                sprintf(msg,"[DefBot] %s purchased a Samsite for 1000 credits.",Get_Player_Name(Player),1000);
                Send_Message_Team(0,255,0,0,msg);
                Create_2D_WAV_Sound_Team("m00evan_dsgn0002i1evan_snd.wav",0);
        }
        else
        {
                char infunds[250];
                sprintf(infunds,"[DefBot] Insufficient Funds: Samsite cost 1000 credits on this map",1000);
                Send_Message_Team(0,255,0,0,infunds);
                Create_2D_WAV_Sound_Team("m00evan_dsgn0024i1evan_snd.wav",0);
			}
			team = 0;
			}
		}
		}


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Fri, 08 June 2012 01:47]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: I don't get why it don't page the player...
Next Topic: Where can I find Jonwil's Level editor?
Goto Forum:
  


Current Time: Sun Dec 22 03:25:44 MST 2024

Total time taken to generate the page: 0.00714 seconds