Do anyone have?
#2

pawn Код:
if(strcmp(cmd, "/changenick", true) == 0){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /setname [new nick]");
new
namelen;
namelen = strlen( tmp[idx + 1] );
namelen += ( tmp[idx+1] );
for ( new i = idx+1; i < namelen; i++ ){
if ( isalnum( tmp[i] ) || tmp[i] == '_' || tmp[i] == '[' || tmp[i] == ']' )
continue;
else
return SendClientMessage(playerid,COLOR_RED1,"Name can only have the characters: 0-9, A-Z, a-z, [, ] and _" );
}
if(udb_Exists(tmp)){
SendClientMessage(playerid,COLOR_RED1,"This nick already taken!");
}else{
udb_RenameUser(PlayerName2(playerid),tmp);
SetPlayerName(playerid,tmp);
format(string, sizeof(string),"Nick changed to \"%s\"",tmp);
SendClientMessage(playerid,yellow,string);
}
return 1;
}

stock isalnum(c)
{
  if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) return 1;
  else return 0;
}
Maybe this should work, for /changenick
Reply


Messages In This Thread
Do anyone have? - by neox - 13.04.2009, 08:19
Re: Do anyone have? - by Klutty - 13.04.2009, 08:24
Re: Do anyone have? - by neox - 13.04.2009, 08:35
Re: Do anyone have? - by Danut - 13.04.2009, 10:25
Re: Do anyone have? - by Pyrokid - 14.04.2009, 01:17

Forum Jump:


Users browsing this thread: 1 Guest(s)