06.04.2012, 02:03
I was wondering if anyone could show me how to put restrictions on names that can enter my server, im making a role playing server and I want the player to have to have First_Last name and not just first name.
new name[32]; GetPlayerName(playerid, name, sizeof(name)); if(strfind(name, "_", true) == -1) { SendClientMessage(playerid, -1, "Introduce a valid name in the format <FirstName_LastName>"); Kick(playerid); }
new NumericArray[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; // I think this is the away you initialize an array with values in pawno new name[24]; GetPlayerName(playerid, name, sizeof(name)); for(new i = 0; i <= strlen(name); ++i) for(new j = 0; j < 10; ++j) if(name[i] == NumericArray[j]) { SendClientMessage(playerid, -1, "Invalid Name"); Kick(playerid); }