SA-MP Forums Archive
Maxim Size Name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Maxim Size Name (/showthread.php?tid=420399)



Maxim Size Name - TuTh - 04.03.2013

how i can do a limit for the name at OnPlayerConnect ?

between 4 characters and 20 characters


Re: Maxim Size Name - Misiur - 04.03.2013

pawn Код:
public OnPlayerConnect(playerid) {
    new n[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, n);
    if(!(4 <= strlen(n) <= 20)) {
        SendClientMessage(playerid, -1, "NOPE");
        return Kick(playerid);
    }
    return 1;
}



Re: Maxim Size Name - Scenario - 04.03.2013

... why would you want to limit that? SA:MP natively limits player names to 25 characters anyways.