Name with _ like in roleplay

Started by Kewun, Jul 27, 2016, 07:10 PM

Previous topic - Next topic

Kewun

I want a script

where you have to use a name with usage _ like in samp roleplay server,s

example, Sebastian_Klemens

real names

how?

EK.IceFlake

if (player.Name.find("_") == null) //Do your shets here

aXXo

Split player name with _
Make sure, the number of tokens == 2
Make sure both token's string length is > 1

Luis_Labarca

I use this in my rp

if (player.Name.find( "_" ) == null){
MessagePlayer( "[#FFFFFF]Porfavor usa el formato correcto: Nombre_Apellido", player );
MessagePlayer( "[#FFFFFF]Vuelve a entrar con el formato indicado.", player );
KickPlayer( player );
}
My server RP
IP: 51.222.28.159:8194

EK.IceFlake

#4
Quote from: aXXo on Jul 27, 2016, 07:45 PMSplit player name with _
Make sure, the number of tokens == 2
Make sure both token's string length is > 1
function CPlayer::IsNiceName()
try
{
    local sSplitName = Name.split("_");
    if (sSplitName.len() != 2) return 0;
    if (sSplitName[0].len() > 1 && sSplitName[1].len() > 1) return 1;
}
catch (e)
{
    return 0;
}
Usage:
int CPlayer.IsNiceName()
if (CPlayer.IsNiceName() == 0) //fuck this player up, how dare he choose this shitty and ridiculous name!!!

Kewun