[pawn]
#include <a_samp>
public OnPlayerConnect(playerid)
{
new player_name[MAX_PLAYER_NAME];
GetPlayerName(playerid,player_name,sizeof player_name);
if(CheckRpName(player_name)) { }
else {
SendClientMessage(playerid,0xAA3333AA,\"A neved nem felel meg az RP szabványnak\");
SendClientMessage(playerid,0xAA3333AA,\"Vezetékneved_Keresztneved\");
Kick(playerid);
}
return 1;
}
stock CheckRpName(const name[]){
new length=strlen(name),ch;
for(ch=0; ch<length; ch++) if(name[ch]) break;
if(ch==(length+1)) return false;
for(ch=0; ch<length; ch++) {
if((ch>=2) && (ch<=(length-2))) {
if((name[ch]>=\'a\')&&(name[ch]<=\'z\')||(name[ch]>=\'A\')&&(name[ch]<=\'Z\')||name[ch]==\'_\') {}
else return false;
}
else {
if(name[ch]==\'_\') return false;
}
}
return true;
}
[/pawn]