C++ Problem. [message #339748] |
Tue, 08 July 2008 12:46 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
Hey guys, i'm having a problem here.
There is something wrong with this line here:
const char *preset = Get_Preset_Name(Text[1].c_str());
The error that shows up is :
Quote: | Error 1 error C3861: 'Get_Preset_ID': identifier not found c:\Westwood\RenegadeFDS\Server\gmmain.cpp 2479
|
What is the problem. I cant seem to figure it out.
Note: I just installed VS C++ 2009 because VS2005 is not working. But VS2009 compiled SSGM when i first opened it.
This account is no longer being active.
|
|
|
|
|
Re: C++ Problem. [message #339753 is a reply to message #339750] |
Tue, 08 July 2008 12:56 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
I got this error now
Error 1 error C2664: 'const char *(GameObject *)' : cannot convert parameter 1 from 'const char *' to 'GameObject *' c:\Westwood\RenegadeFDS\Server\gmmain.cpp 2479
This account is no longer being active.
|
|
|
|
Re: C++ Problem. [message #339809 is a reply to message #339787] |
Tue, 08 July 2008 17:39 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
Why, the error is only on that line.
And i dont like putting my codes here because this is what happened once.
I was making a jail code and i had errors. I posted a code here so i could get help. After a day or 2 people strted to use that code and didnt give me any credit but gave the credit for the person that fixed the error. I just couldnt explain to cpjok that it was my code, but he kept saying that roshambo made it.
This account is no longer being active.
|
|
|
Re: C++ Problem. [message #339824 is a reply to message #339748] |
Tue, 08 July 2008 18:54 |
|
Veyrdite
Messages: 1471 Registered: August 2006 Location: Australia, Sydney
Karma: 0
|
General (1 Star) |
|
|
Commonly with C++ the line that is reporting errors on isn't actually the line with errors - instead lines before it have stuffed up the syntax. Go through your code from the beginning to that point or comment lines out until you have found the culprit.
WOL: Veyrdite Previously: Dthdealer ( a long time ago )
[Updated on: Tue, 08 July 2008 18:55] Report message to a moderator
|
|
|
Re: C++ Problem. [message #339827 is a reply to message #339824] |
Tue, 08 July 2008 19:00 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
// SCRIPT MADE BY HEAVYX101, REMEMBeR THAT!
class presetbuildChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *Own = Get_GameObj(ID);
const char *preset = Commands->Get_Preset_Name(Text[1].c_str());
Vector3 position;
position = Commands->Get_Position(obj);
position.Z += 0;
position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
{
GameObject *object = Commands->Create_Object("%d",preset));
Console_Input(StrFormat("msg WORKS!").c_str());
Commands->Set_Facing(obj, Commands->Get_Facing(obj)-180);
}
}
};
ChatCommandRegistrant<presetbuildChatCommand> presetbuildChatCommandReg("!pbuild",CHATTYPE_ALL,1,GAMEMODE_AOW);
That is the whole command i'm working on.
This account is no longer being active.
[Updated on: Tue, 08 July 2008 19:10] Report message to a moderator
|
|
|
Re: C++ Problem. [message #339836 is a reply to message #339748] |
Tue, 08 July 2008 19:24 |
|
Veyrdite
Messages: 1471 Registered: August 2006 Location: Australia, Sydney
Karma: 0
|
General (1 Star) |
|
|
The last two lines are a bit questionable. A semi-colon after a closing bracket?
Note that I've never been near Renegade C++ rather other versions for other games.
WOL: Veyrdite Previously: Dthdealer ( a long time ago )
|
|
|
Re: C++ Problem. [message #339841 is a reply to message #339836] |
Tue, 08 July 2008 19:47 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
I havent work with coding for like 3 weeks now, i think i forgot some stuff
This account is no longer being active.
|
|
|
Re: C++ Problem. [message #339849 is a reply to message #339841] |
Tue, 08 July 2008 21:00 |
|
Veyrdite
Messages: 1471 Registered: August 2006 Location: Australia, Sydney
Karma: 0
|
General (1 Star) |
|
|
HeavyX101 wrote on Wed, 09 July 2008 12:47 | I havent work with coding for like 3 weeks now, i think i forgot some stuff
|
Try having a reference page open next to the script window.
WOL: Veyrdite Previously: Dthdealer ( a long time ago )
|
|
|