0 Membres et 1 Invité sur ce sujet
/**** RolePlay Name Check ****/new charCount[4], playerName[MAX_PLAYER_NAME];GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);for(new i = 0; i < MAX_PLAYER_NAME; i++){ switch(playerName[i]) { case '[', ']', '(', ')' : charCount[0]++; case '0' .. '9' : charCount[1]++; case 'a' .. 'z' : charCount[2]++; case 'A' .. 'Z' : charCount[3]++; } }if(charCount[0]){ SendClientMessage(playerid, COLOR_RED, "Votre nom est invalide. \nil contient un caractére interdit."); SendClientMessage(playerid, COLOR_ORANGE, "Exemple de nom_prenom valide : John_Carter"); return Kick(playerid); }if(charCount[1]){ SendClientMessage(playerid, COLOR_RED, "Votre nom est invalide.\n il contient un chiffre."); SendClientMessage(playerid, COLOR_ORANGE, "Exemple de nom_prenom valide : John_Carter"); return Kick(playerid); }if(charCount[2] < 3){ SendClientMessage(playerid, COLOR_RED, "un nom doit contenir au minimum 3 caractéres minuscules"); SendClientMessage(playerid, COLOR_ORANGE, "Exemple de nom_prenom valide : John_Carter"); return Kick(playerid); }if(charCount[3] != 2){ SendClientMessage(playerid, COLOR_RED, "un nom_prenom doivent commencer par des majuscules"); SendClientMessage(playerid, COLOR_ORANGE, "Exemple de nom_prenom valide : John_Carter"); return Kick(playerid); }else ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_LIST, "Menu Inscription", "Suivre le tutoriel RolePlay\nS'incrire", "Choisir", "Annuler");
if(regex_match(playerName, "^[A-Z]{1}[a-zA-Z]{2,12}_[A-Z]{1}[a-z]{2,12}$")) { / **** que faire si le nom est valide ****/}else // nom invalide{ SendClientMessage(playerid, COLOR_RED, "Votre est incorrect. veuillez inserer un nom correct"); SendClientMessage(playerid, COLOR_ORANGE, "Exemple : John_Carter");}
A__b__c__D__e__fABcdef____________________ABcdef