cnhange this....
#1

how to i change this so that it detects if u [number] in ur name? so if ur name is '[4]Mowgli' or 'mowgli[6]' or somthing... u get kicked

Код:
public OnPlayerConnect(playerid)
{
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pName,sizeof(pName));
	if(strfind(pName,"_",true) == -1) { Kick(playerid); }
	return 1;
}
Reply
#2

If you want something like [4]:
pawn Код:
new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
strdel(playerName, 6, sizeof(playerName));
if(!strfind(playerName, "[4]", true))
{
// code
}
Reply
#3

pawn Код:
stock func(const pName[]){
  new
    start = strfind(pName,"[");
    end = strfind(pName,"]");
  if(start != -1 && end != -1 && start < end){
    while(start < end){
      if(pName[start] < '0' && pName[start] > '9') return false;
      start++;
    }
  }else return false;
  return true;
}
Reply


Forum Jump:


Users browsing this thread: