• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How /attr Command Works On Items At TFS 0.3.7_svn 9.86

shiko4ever

New Member
Joined
Jun 6, 2009
Messages
89
Reaction score
0
How To Make /attr Works On 0.3.7 Items To Custom Like 8.60

/attr set attack 20<<Something like that its not work in TFS 0.3.7
 
Code:
if(action == "set" || action == "add" || action == "new")
			{
				std::string type = parseParams(it, tokens.end()), key = parseParams(it,
					tokens.end()), value = parseParams(it, tokens.end());
				if(type == "integer" || type == "number" || type == "int" || type == "num")
					item->setAttribute(key.c_str(), atoi(value.c_str()));
				else if(type == "float" || type == "double")
					item->setAttribute(key.c_str(), (float)atof(value.c_str()));
				else if(type == "bool" || type == "boolean")
					item->setAttribute(key.c_str(), booleanString(value));
				else
					item->setAttribute(key.c_str(), value);
			}

According to this, you have to provide the data type as well.

/attr set number attack 20
 
Well, you don't need to understand anything in the code, just know that if you want to use a numbered value in the command, you'd have to write out the data type.
I wrote out your solution at the bottom of the post.
 
Back
Top