hmm il try it :S
ok ne question i got this code form white dragon to make it able to read and text file for each of my codes can have a diffrenet mod list heres the code
bool Is_Mod(const char *File, const char *Name) {
fstream; file(File, ios::in);
string; tmp;
while(file >> tmp) {
if(strcmp(Name, tmp.c_str()) == 0) {
return true;
}
}
return false;
};
heres the command
bool class TestChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (Is_Mod("Test_Mods.txt",Get_Player_Name_By_ID(ID))) {
GameObject *obj = Get_GameObj_By_Player_Name(Text[0].c_str());
Change_Team(obj,2);
Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_Nod",false);
SimpleDynVecClass<GameObject*> List = Get_All_Objects_By_Preset(2,"Signal_Flares");
int Rand = Commands->Get_Random_Int(0,List.Count());
GameObject *RandObj = List[Rand];
Commands->Set_Position(obj,Commands->Get_Position(RandObj));
}
}
}
and heres the error
------ Rebuild All started: Project: Plugin, Configuration: Release Win32 ------
Deleting intermediate and output files for project 'Plugin', configuration 'Release|Win32'
Compiling...
cl : Command line warning D9040 : ignoring option '/analyze'; Code Analysis warnings are not available in this edition of the compiler
scripts.cpp
scriptregistrar.cpp
scriptfactory.cpp
mmgr.cpp
engine_weap.cpp
engine_threading.cpp
engine_tdb.cpp
engine_string.cpp
engine_script.cpp
engine_pt.cpp
engine_player.cpp
engine_phys.cpp
engine_obj2.cpp
engine_obj.cpp
engine_net.cpp
engine_math.cpp
engine_io.cpp
engine_game.cpp
engine_dmg.cpp
engine_diagnostics.cpp
Compiling...
engine_def.cpp
engine_common.cpp
engine_bhs.cpp
dllmain.cpp
plugin.cpp
.\plugin.cpp(63) : error C2065: 'fstream' : undeclared identifier
.\plugin.cpp(63) : error C2653: 'ios' : is not a class or namespace name
.\plugin.cpp(63) : error C2065: 'in' : undeclared identifier
.\plugin.cpp(63) : error C3861: 'file': identifier not found
.\plugin.cpp(64) : error C2065: 'string' : undeclared identifier
.\plugin.cpp(64) : error C2065: 'tmp' : undeclared identifier
.\plugin.cpp(65) : fatal error C1903: unable to recover from previous error(s); stopping compilation
gmsettingsclass.cpp
gmmain.cpp
gmfunc.cpp
gmcommandclass.cpp
engine_gm.cpp
date.cpp
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version 8.00.50727
Copyright (C) Microsoft Corporation. All rights reserved.
BSCMAKE: error BK1506 : cannot open file '.\tmp\scripts\plugin.sbr': No such file or directory
Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Temp\SSGM 2.0.1 WFDS\Plugin Example Source\Plugin Example Source\tmp\scripts\BuildLog.htm"
Plugin - 8 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
now white dragon made the random part in the code and the bool thing so maybe he can tell me whats wrong?
so pretty much the code he gave me is missing somthing or somthing
[Updated on: Thu, 12 July 2007 14:51]
Report message to a moderator