1
Scripting / help to find letter postion
« on: November 12, 2018, 02:05:27 AM »
Hi. i need help regarding this code:
local charlist = [ "a", "b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0"];
//return the first letter of the game
function firstletter()
{
local pstrip = fe.game_info(Info.Title).slice(0,1);
return pstrip;
}
//return the index position of letter game
function findchar()
{
local pstrip = fe.game_info(Info.Title).slice(0,1);
foreach (index, item in charlist) {
if (item == pstrip) {
return index;
}
}
}
local lettera = fe.add_text( "[!firstletter] ", 25+[!findchar], 25, 70, 35 );
i have an error "null 0x000"returnig the value index.
...if (item == "d").... in this case index value is "3" correct
My goal is to create an alphabet bar with char select. Please Help
local charlist = [ "a", "b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0"];
//return the first letter of the game
function firstletter()
{
local pstrip = fe.game_info(Info.Title).slice(0,1);
return pstrip;
}
//return the index position of letter game
function findchar()
{
local pstrip = fe.game_info(Info.Title).slice(0,1);
foreach (index, item in charlist) {
if (item == pstrip) {
return index;
}
}
}
local lettera = fe.add_text( "[!firstletter] ", 25+[!findchar], 25, 70, 35 );
i have an error "null 0x000"returnig the value index.
...if (item == "d").... in this case index value is "3" correct
My goal is to create an alphabet bar with char select. Please Help