Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripting Problems (Getting Infantry Gender through scripts)
Scripting Problems [message #274226] Thu, 19 July 2007 10:16 Go to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Okay, I have been trying to use the script function "Get_Sex" (which sends an A for male and a B for female) to try to make the script detect when it is a male or female, currently I can't get it to do anything, when ever I try making it something like:
char sex = Get_Sex(obj);
if (sex == "A")

And many other attempts with comma's and other stuff I get back an error that const char can not equal a char. Is there a way I could convert the letter A to a char? Or a better way to do the?


Re: Scripting Problems [message #274232 is a reply to message #274226] Thu, 19 July 2007 10:45 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
shouldn't it be == 'a' if it returns a char? "" is for strings, '' for char

http://steamsignature.com/card/1/76561197975867233.png
Re: Scripting Problems [message #274236 is a reply to message #274232] Thu, 19 July 2007 11:12 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
danpaul88 wrote on Thu, 19 July 2007 11:45

shouldn't it be == 'a' if it returns a char? "" is for strings, '' for char

Yep! Looks like all that I needed to do was put 'a', I learn something new every day, thank Danpaul88. Now my 12kb script is working so I am happy


Previous Topic: bot spawn error
Next Topic: FieldTS.lvl
Goto Forum:
  


Current Time: Tue May 07 18:11:22 MST 2024

Total time taken to generate the page: 0.00559 seconds