Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » can anyone just help me finish my code?
Re: can anyone just help me finish my code? [message #268892 is a reply to message #268783] Tue, 26 June 2007 11:18 Go to previous messageGo to previous message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma:
Colonel
else if (stristr(Msg2, "!Teleport <players name>") == 0 && strcmp(Get_Player_Name_By_ID(ID),"<nick>") == 0) {


Are you expecting to to compile a version of the scripts.dll for each person in the game?

I believe the best way to have one command for this is to tokenize the string seperating the char* into two parts.

For yourself, it may be easier to convert Msg2 into a std::string for the time being and using subrstr(Start, Length).

It has been a while since I have looked into the scripts/bhs.dll but you could perform something like the following?


std::string ChatMsg(Msg2);
else if (ChatMsg.substr(0, 9) == "!Teleport") {
const char* TargetName = Get_Player_Name_By_ID(atoi(ChatMsg.substr(10).c_str));



PS: This is an idea, not complete code and may require editing.


Let all your wishes be granted except one, so you will still have something to strieve for.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: the kamiux serv sustom made things
Next Topic: Random Char Error I need Fixed
Goto Forum:
  


Current Time: Thu Jan 02 06:32:52 MST 2025

Total time taken to generate the page: 0.00896 seconds