nobukadnezar Posted October 10, 2013 Posted October 10, 2013 Hi there, it's me again lol Is there a code for check character prefix like "PRE Charname" npc will check if the character name have prefix PRE, then they will pass. Thank you Quote
Patskie Posted October 10, 2013 Posted October 10, 2013 Try this : explode(.@pre$, strcharinfo(0), " "); dispbottom "Prefix : " +.@pre$[0]; Quote
GmOcean Posted October 10, 2013 Posted October 10, 2013 if( compare(strcharinfo(0),"PRE") ){ do this } else { end; } However, this will only check to see if they have those 3 letters in there name. To check to see if they are the FIRST 3 letters we need to do this: if( charat( strcharinfo(0), 0 ) == "P" && charat( strcharinfo(0), 1 ) == "R" && charat( strcharinfo(0), 2 ) == "E" ){ do this } else { end; } The above will check to see if the FIRST 3 letters of the players name is PRE. Keep in mind though, it is checking for Case Sensitive PRE. There is a way to bypass that, but I didn't put that in since your looking for PRE specifically. Quote
Capuche Posted October 10, 2013 Posted October 10, 2013 or if ( substr( strcharinfo(0),0,2 ) == "PRE" ) or if ( strpos( strcharinfo(0),"PRE",0 ) == 0 ) to check the 3 first letters Quote
GmOcean Posted October 10, 2013 Posted October 10, 2013 That will work as well. I forgot those commands are there >.>; Quote
nobukadnezar Posted October 11, 2013 Author Posted October 11, 2013 Wow guys thanks for ur reply. I will try after work Quote
Question
nobukadnezar
Hi there, it's me again lol
Is there a code for check character prefix like "PRE Charname"
npc will check if the character name have prefix PRE, then they will pass.
Thank you
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.