Checking Usernames containing - Help

xoxdragonxox

New Member
Reaction score
1
Each time you are promoted.. the initials of the ranks name is infront of your name so lets say you got promoted to Private First Class. and your user name is Dragon

so the name would be Pfc.Dragon.........what i need is how do i make a trigger that i can detect if someone has 3 letters in the front of their name and is pfc so then i can make an action for it.
 

DrEvil

FCRI Associate!
Reaction score
111
In that trigger where he gets promoted , wont you know if his name changes ? ( * )
Well when you change the name cant you run the actions there ? ( * )

* - Utterly confused ....
 

xoxdragonxox

New Member
Reaction score
1
My buddy made my multi-board in jass i dotn understand jass!

What he forgot to add was when they get promoted the name colour changes

so he told me i cann just use a trigger to detect if they have either Pfc. or Col. or whatever the rank is in their name and i can make an action to change colour.

So what i need is i need to know how to detect if the players has a specific amount of letters in their name such as Pfc. and usealy it would be infront of the name so Pfc.Dragon

Thanks
 

DrEvil

FCRI Associate!
Reaction score
111
So , cant you change there colour from the promotion trigger ?

Like when you change it , get which letters , then set the string to which ever colour you need ?
 

xoxdragonxox

New Member
Reaction score
1
the trigger he did is all in this complicated jass. so all i need is somehow to detect if the player has a pfc in their name i found this

JASS:
CheckRank
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
        (Name of Player 1 (Red)) Equal to Pfc.Dragon
    Actions
        Player - Add 1000 to Player 1 (Red) Current gold


but thats not rit cause its checking the whole username i only want it to check pfc seeing as there will be 23 ranks!
 

Azlier

Old World Ghost
Reaction score
461
Substrings, substrings, substrings... They allow you to read only a part of a string.

Trigger:
  • Rawr
    • Events
      • Player - Player 1 (Red) types a chat message containing -test as An exact match
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Name of (Triggering player)), 1, 4)) Equal to (==) Pfc.
        • Then - Actions
          • -------- Blah, blah, blah Actions... --------
          • Skip remaining actions
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Name of (Triggering player)), 1, 4)) Equal to (==) Col.
        • Then - Actions
          • -------- Blah, blah, blah Actions... --------
          • Skip remaining actions
        • Else - Actions
      • -------- And so on. --------
 

DrEvil

FCRI Associate!
Reaction score
111
Was the promotion trigger in jass ?

Well you acn only check there name , by looping every so often ( 1 - 3 seconds ) , but in the promotion trigger , you should be able to tell where his name gets changed ?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top