If player name includes '_'..
#1

How do I get the script to check if a player's name includes '_'?
Reply
#2

strfind is all you need.

pawn Code:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof pName);

    if(strfind(pName, "_") != -1) {
        // Name has underscore.
    }
Reply
#3

Quote:
Originally Posted by GRiMMREAPER
View Post
strfind is all you need.

pawn Code:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof pName);

    if(strfind(pName, "_") != -1) {
        // Name has underscore.
    }
Great, I'll check this out and see if it worked (I'm sure it will)

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)