DarthRaff Posted May 6, 2014 Share Posted May 6, 2014 Hello, can someone tell me what i doing wrong here: // Send to screen Flip(0) ; TEntity ent; string cname; for (int i = 1; i <= CountChildren(playermesh); i++) { ent = GetChild(playermesh,i); cname=GetEntityKey(ent,"classname",""); printf(cname); Delay(3000); } Thankyou very much Quote Link to comment Share on other sites More sharing options...
Rick Posted May 6, 2014 Share Posted May 6, 2014 What error are you getting? Quote Link to comment Share on other sites More sharing options...
DarthRaff Posted May 6, 2014 Author Share Posted May 6, 2014 1>j:\projects_2.50\prueba1_250\prueba1_250.cpp(573) : error C2882: 'std' : illegal use of namespace identifier in expression 1>j:\projects_2.50\prueba1_250\prueba1_250.cpp(574) : error C3861: 'Delay': identifier not found The errors Quote Link to comment Share on other sites More sharing options...
Rick Posted May 6, 2014 Share Posted May 6, 2014 std::string cname; instead of just string cname, will fix the first one. Your second error is saying the function Delay() doesn't exist. Quote Link to comment Share on other sites More sharing options...
DarthRaff Posted May 6, 2014 Author Share Posted May 6, 2014 Ah, thankyou, and what can i use instead of delay ? New error in printf: 1>j:\projects_2.50\prueba1_250\prueba1_250.cpp(573) : error C2664: 'printf' : cannot convert parameter 1 from 'std::string' to 'const char *' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Quote Link to comment Share on other sites More sharing options...
Rick Posted May 6, 2014 Share Posted May 6, 2014 try printf(cname.c_str()); printf() is old school and doesn't know about the string class so it's function c_str() converts it to plain old char* Quote Link to comment Share on other sites More sharing options...
DarthRaff Posted May 6, 2014 Author Share Posted May 6, 2014 No error now, thankyou for your time Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 6, 2014 Share Posted May 6, 2014 And in answer to your other question (though you may have already figured it out) try Sleep(3000); Quote Link to comment Share on other sites More sharing options...
DarthRaff Posted May 6, 2014 Author Share Posted May 6, 2014 Yeah, thankyou Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.