nobukadnezar Posted October 10, 2013 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 163 Reputation: 7 Joined: 01/07/12 Last Seen: March 7, 2017 Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted October 10, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 5 hours ago Share Posted October 10, 2013 Try this : explode(.@pre$, strcharinfo(0), " "); dispbottom "Prefix : " +.@pre$[0]; Quote Link to comment Share on other sites More sharing options...
GmOcean Posted October 10, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted October 10, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
GmOcean Posted October 10, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted October 10, 2013 That will work as well. I forgot those commands are there >.>; Quote Link to comment Share on other sites More sharing options...
nobukadnezar Posted October 11, 2013 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 163 Reputation: 7 Joined: 01/07/12 Last Seen: March 7, 2017 Author Share Posted October 11, 2013 Wow guys thanks for ur reply. I will try after work Quote Link to comment Share on other sites More sharing options...
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
Link to comment
Share on other sites
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.