Name restrictions
#1

Please lock and bin the topic.,
Reply
#2

Try using this function: GetPlayerName(playerid, name, sizeof(name));


So somthing like this:

pawn Код:
if(GetPlayerName(playerid, name, sizeof(name) != "David_Johnson" || "Melinda_Washington")//You might need to format these names; I haven't tested this code yet...
{
    GameTextForPlayer(playerid, "~r~Access Denied!", 3500, 4);
    return 1;
}
Reply
#3

pawn Код:
new allowed_names[][] =
{
     "David_Johnson",
     "Melinda."
};

// Where you check
new name[ 24 ]; GetPlayerName(playerid, name , 24);
for( new i = 0; i < sizeof(allowed_names); i++ )
{
   if( strcmp( name, allowed_names[i], true) != -1)
   {
       // Allow names
   }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)