Home » Renegade Discussions » Mod Forum » Scripting Help
Re: Vector3 pos [message #418243 is a reply to message #418187] |
Sat, 23 January 2010 02:57 |
|
Gen_Blacky
Messages: 3250 Registered: September 2006
Karma:
|
General (3 Stars) |
|
|
Can some one tell me why this chat command isn't working correctly> I don't understand how gdiplayer == nodplayer does not = even teams.
class TeamChangeChatCommand : public ChatCommandClass
{
void Triggered(int ID,const TokenClass &Text,int ChatType)
{
GameObject *obj = Get_GameObj(ID);
int gdiPlayers = (Tally_Team_Size(1));
int nodPlayers = (Tally_Team_Size(0));
int team = Get_Object_Type(obj);
if (team == 1)
{
printf("GDI\n");
nodPlayers++;
if (nodPlayers < gdiPlayers)
{
printf("Change Team GDI to Nod\n");
Change_Team_By_ID(ID,0);
char message[256];
sprintf(message,"msg Player %s has changed to Team Nod to make the teams even.", Get_Player_Name_By_ID(ID));
Console_Input(message);
}
else if (nodPlayers == 0)
{
char message[256];
sprintf(message,"msg You are the only player on GDI", Get_Player_Name_By_ID(ID));
Console_Input(message);
}
else if (nodPlayers == gdiPlayers)
{
char message[256];
sprintf(message,"msg Teams are Even", Get_Player_Name_By_ID(ID));
Console_Input(message);
//Console_Input(StrFormat("msg Teams are Even.",Get_Player_ID(obj)).c_str();
}
else
{
//Console_Input(StrFormat("msg Sorry GDI doesn't have enough Players!.",Get_Player_ID(obj)).c_str();
char message[256];
sprintf(message,"msg Sorry GDI doesn't have enough Players!", Get_Player_Name_By_ID(ID));
Console_Input(message);
}
}
if (team == 0)
{
printf("NOD\n");
gdiPlayers++;
if (gdiPlayers < nodPlayers)
{
printf("Change Team Nod to GDI\n");
Change_Team_By_ID (ID,1);
char message[256];
sprintf(message,"msg Player %s has changed to Team GDI to make the teams even.", Get_Player_Name_By_ID(ID));
Console_Input(message);
}
else if (gdiPlayers == 0)
{
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();
}
else if (gdiPlayers == nodPlayers)
{
char message[256];
sprintf(message,"msg Teams are Even", Get_Player_Name_By_ID(ID));
Console_Input(message);
}
else
{
//Console_Input(StrFormat("msg Sorry NOD doesn't have enough Players!.",Get_Player_ID(obj)).c_str();
char message[256];
sprintf(message,"msg Sorry NOD doesn't have enough Players!", Get_Player_Name_By_ID(ID));
Console_Input(message);
}
}
}
};
ChatCommandRegistrant<TeamChangeChatCommand> TeamChangeChatCommandReg("!TeamChange;!tc;!switch;",CHATTYPE_TEAM,0,GAMEMODE_ALL);
[Updated on: Sat, 23 January 2010 02:58] Report message to a moderator
|
|
|
|
|
Scripting Help
|
|
|
Re: Vector3 pos
By: Sir Kane on Fri, 22 January 2010 16:31
|
|
|
Re: Vector3 pos
By: zunnie on Fri, 22 January 2010 22:16
|
|
|
Re: Vector3 pos
|
|
|
Re: Vector3 pos
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 03:39
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 13:01
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 15:23
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sun, 24 January 2010 03:38
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 27 January 2010 07:34
|
|
|
Re: Scripting Help
By: cAmpa on Mon, 25 January 2010 15:31
|
|
|
Re: Scripting Help
By: Hex on Wed, 27 January 2010 07:06
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 27 January 2010 17:52
|
|
|
Re: Scripting Help
By: Hex on Thu, 28 January 2010 02:44
|
|
|
Re: Scripting Help
By: raven on Thu, 28 January 2010 10:31
|
|
|
Re: Scripting Help
By: reborn on Fri, 29 January 2010 16:37
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Sat, 30 January 2010 03:08
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 24 February 2010 03:35
|
|
|
Re: Scripting Help
By: Tunaman on Wed, 24 February 2010 08:16
|
|
|
Re: Scripting Help
By: raven on Wed, 24 February 2010 08:40
|
|
|
Re: Scripting Help
By: reborn on Wed, 24 February 2010 08:45
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Wed, 24 February 2010 12:46
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Wed, 24 February 2010 14:47
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Hex on Sun, 04 April 2010 02:44
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
Goto Forum:
Current Time: Tue Dec 24 14:07:48 MST 2024
Total time taken to generate the page: 0.01100 seconds
|