Premium Speachless 759 Posted March 28, 2015 Premium Share Posted March 28, 2015 So this is the letter part . if pc . get_name ( ) == "[%]" then send_letter ( "Anunta ca esti online" ) return end But it don't send the letter ,,Anunta ca esti online '' , someone know how to make it get the all name with rank [MOD] or [%] all ? Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 28, 2015 Share Posted March 28, 2015 Make for each character name with rank - more easy. Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted March 28, 2015 Author Premium Share Posted March 28, 2015 I made it, but i dont want make maintenances to add anothers moderators acces on that quest My moderatos don't have gm rank, so i cant use the gm function . Link to comment Share on other sites More sharing options...
Systeman 9 Posted March 28, 2015 Share Posted March 28, 2015 try lua function string.find if string.find(pc.get_name(), "[%]") then send_letter ( "Anunta ca esti online" ) return end Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 28, 2015 Share Posted March 28, 2015 try lua function string.find if string.find(""..pc.get_name().."", "[MOD]") then send_letter ( "Anunta ca esti online" ) return end I corrected a little. Maybe works. Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted March 28, 2015 Author Premium Share Posted March 28, 2015 I test it now. Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted March 28, 2015 Author Premium Share Posted March 28, 2015 Same problem Link to comment Share on other sites More sharing options...
Alina 234 Posted March 28, 2015 Share Posted March 28, 2015 string.find does not return bool! It returns the position where it found the pattern. Also it returns nil if the pattern is not found within the string. Try it with that: if string.find(pc.get_name(), "[%s]") != nil then This should do the trick The ""..pc.get_name().."" has no use. You're just concatenating an empty string with the player name and then an empty string again. The result is the same as you'd get it when you just use pc.get_name() Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now