Command To Test An Anim

Started by Mohamed Boubekri, Apr 09, 2018, 10:09 AM

Previous topic - Next topic

Mohamed Boubekri

Hi, i Made Just a Sample Command To Test Anim, To work of thi Use /animstest <ID> <ID>
Example: /animstest 0 0
if ( cmd == "animstest" || cmd == "testanims")
{
if(!text) MessagePlayer("[ANIM TEST] /"+cmd+" <ID> <ID>", player );
else {
local anim = GetTok( text, " ", 1);
if ( !anim ) MessagePlayer("Make a ID For Anim 1 First..",player);
else if (!IsNum(anim)) MessagePlayer("ID's Must Be In Numbers..",player);
else {
local anim1 = GetTok( text, " ", 1);
if ( !anim1 ) MessagePlayer("Make a ID For Anim 2 First..",player);
else if (!IsNum(anim1)) MessagePlayer("ID's Must Be In Numbers..",player);
else {
player.SetAnim(anim.tointeger(),anim1.tointeger());
}
}
}
}

Don't Forget The Two Functions:-
function GetTok(string, separator, n, ...)
 {
 local m = vargv.len() > 0 ? vargv[0] : n,
 tokenized = split(string, separator),
 text = "";
 if (n > tokenized.len() || n < 1) return null;
 for (; n <= m; n++)
  {
  text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
  }
 return text;
 }
 
 function NumTok(string, separator)
 {
 local tokenized = split(string, separator);
 return tokenized.len();
 }
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].