22.04.2011, 19:14
HI! I need a fast way to make a thing that makes the max player name length thing be.. 15 or so.. PLEASE HELP!
#define REAL_MAX_PLAYER_NAME 15
#undef MAX_PLAYER_NAME
#define MAX_PLAYER_NAME 15
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(sizeof(pname) > 12)
{
SendClientMessage(playerid, red, "GTFO!");
Kick(playerid)
}
public OnPlayerConnect(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(strlen(pName) > 15) // Will kick the player if his name is longer than 15 characters.
{
SendClientMessage(playerid, COLOR_RED, "Your name is too long, blahblah.");
Kick(playerid);
return 1;
}
return 1;
}
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(sizeof(name) >= 13) {
SendClientMessage(playerid, COLOR_YELLOW, "GTFO!");
Kick(playerid);
}
return 1;
}