Pazleysox
Member
I've been using this code for many months for my chatbot to help people in dreadsylvania with element, and monster banishing.
I only just found out today that if a user has a space in their name, the script aborts.
I did not write this, it was written for me.
Here's the error I'm getting:
I'm not sure how to fix this... Is there anyone who sees the problem?
I only just found out today that if a user has a space in their name, the script aborts.
I did not write this, it was written for me.
Code:
record note
{
string sender;
int date;
}
[int] ChatLog;
int NE= count(ChatLog);
ChatLog[NE].sender= sender;
Map_to_File(ChatLog,"Chatlog.txt");
{
string [int] my_list;
file_to_map( "chatlog.txt" , my_list);
playerdata player;
string temp = "";
string user = "";
foreach i,playername in my_list
{
player = GetPlayer( playername );
if( player.name != "" )
{
if( temp != "" ) temp += ", ";
temp += player.clanname;
user += player.name;
}
}
cli_execute("/whitelist " + temp);
if (temp != get_clan_name())
{print("Error!!");
chat_private(user, "I couldn't join your clan " + temp +", perhaps I don't have a whitelist?");
return;}
Here's the error I'm getting:
Code:
Incoming PM from Paz Sox saying: testhot
[COLOR="#FF0000"]Player "Paz Sox" not found![/COLOR]
Sorry, you don't seem to be cool enough to have a whitelist for a clan like ''.
Error!!
Unknown recipient "I". Message (couldn't join your clan , perhaps I don't have a whitelist?) not sent.
I'm not sure how to fix this... Is there anyone who sees the problem?