Get name of the p3d file of the given class name.
489 {
491 {
492 string cfg =
"CfgVehicles " +
class_name +
" model";
493 string model_path;
494 if (
g_Game.ConfigGetText(cfg, model_path) )
495 {
496 int to_substring_end = model_path.
Length() - 4;
497 int to_substring_start = 0;
498
499
500 for (int i = to_substring_end; i > 0; i--)
501 {
502 string sign = model_path.
Get(i);
503 if ( sign == "\\" )
504 {
505 to_substring_start = i + 1;
506 break
507 }
508 }
509
510 string model_name = model_path.
Substring(to_substring_start, to_substring_end - to_substring_start);
511 return model_name;
512 }
513 }
514
515 return "UNKNOWN_P3D_FILE";
516 }
class OptionSelectorMultistate extends OptionSelector class_name
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.