Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripting Help
Re: Scripting Help [message #418244 is a reply to message #418187] Sat, 23 January 2010 03:39 Go to previous messageGo to previous message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma:
General (1 Star)
@Your script zone questions;
Gen_Blacky wrote on Sat, 23 January 2010 07:10

Thank you how would i set the size of the script zone and did I use the xyz cords wrong.

GameObject *zone = Commands->Create_Object("Script_Zone_All",Vector3(-83.531f,-89.294f,-0.589f));

How do i use

Attach_Script_Once
or
Attach_Script

with more then 3 peramters ?

Would i do it like this ?
Commands->Attach_Script(zone,"script",team,msg);

The use of the Vector3 seems OK. You just have to make sure the coords are right Wink
Also im not sure it works with creating script zones. It does work with PhysicalGameObjects. Never tried it on zones
I dont know how you can set the size, sorry

Attach_Script_Once(obj,"script","param1,param2,param3");
Commands->Attach_Script(obj,"script","param1,param2,param3");


@Your code;

Well the first thing i dont get is why you would increase nodplayers when GDI uses the command;
		if (team == 1) 
		{
			printf("GDI\n");
			nodPlayers++;
		....

and gdiplayers when nod uses it.
		if (team == 0) 
		{
			printf("NOD\n");
			gdiPlayers++;
		....


No wonder it says TEAMS EVEN when you used !tc on Nod. GDI had only 1 player and Nod 2 but you increased GDI first meaning both teams have 2 according to your code

This piece of code is in both teams useless because you increased it by 1 first AND becasue you check for gdiPlayers < nodPlayers first it will never reach this.
else if (gdiPlayers == 0) //or nodPlayers  in GDI ;)
			{
				char message[256];
				sprintf(message,"msg You are the only player on Nod.", Get_Player_Name_By_ID(ID));
				Console_Input(message);
				//Console_Input(StrFormat("msg You are the only player on Nod.",Get_Player_ID(obj)).c_str();
			}

And you are letting it say 'You are the only player on Nod/GDI' while you didnt even checked for that Razz

What i would do is remove
nodPlayers++;
gdiPlayers++;


and change
else if (gdiPlayers == 0) //or nodPlayers  in GDI ;)
			{
				char message[256];
				sprintf(message,"msg You are the only player on Nod.", Get_Player_Name_By_ID(ID));
				Console_Input(message);
				//Console_Input(StrFormat("msg You are the only player on Nod.",Get_Player_ID(obj)).c_str();
			}


To
else if (gdiPlayers == 0 && nodPlayers == 1) //or nodPlayers && gdiPlayers in GDI ;)
			{
				char message[256];
				sprintf(message,"msg You are the only player on Nod.", Get_Player_Name_By_ID(ID));
				Console_Input(message);
				//Console_Input(StrFormat("msg You are the only player on Nod.",Get_Player_ID(obj)).c_str();
			}

and put this as the first action (before the if(gdiPlayers < nodPlayers))

Or just leave it out. Why wouldnt the player have rights to swap when he is the only one?

I hope this helped you Wink


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Sat, 23 January 2010 04:05]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to add startup spawners and spawners etc!!! help!
Next Topic: Cables of the transport.
Goto Forum:
  


Current Time: Sat Nov 30 10:20:04 MST 2024

Total time taken to generate the page: 0.01130 seconds