i create a changenick command and when the player do /changenick nickname the server is down
Код:
if(!strcmp(cmd, "/changenick", true)) {
new newnick[256],String1[100];
newnick = strtok(cmdtext, idx);
if(!strlen(newnick)) return SendClientMessage(playerid,COLOR_YELLOW,"/Changenick [NewNick] [Pass] ");
if(16 < strlen(newnick) || strlen(newnick) < 3) return SendClientMessage(playerid, COLOR_YELLOW, " аешк длйрей цшйк мдйеъ бйп 3 м 16 аеъйеъ ");
if(dini_Int(GetPlayerFile(playerid),"CarId") != 0){
format(file,sizeof(file),"Mode/Car/car%d.txt",dini_Int(GetPlayerFile(playerid),"CarId"));
dini_Set(file,"CarOwner",newnick);}
if(strcmp(dini_Get(GetPlayerFile(playerid),"Clan"),"None.",true)){
format(file,256,"Mode/Clans/%s.ini",dini_Get(GetPlayerFile(playerid),"Clan"));
if(!strcmp(dini_Get(file,"EstablishedBy"),GetName(playerid),true)){
dini_Set(file,"EstablishedBy",newnick);}}
if(IsPlayerViP(playerid)){
new VF[64];
format(VF,sizeof(VF),"Mode/Vip/%s.ini",newnick);
dini_Create(VF);
dini_IntSet(VF,"VipLevel",dini_Int(GetViPFile(playerid),"VipLevel"));
dini_IntSet(VF,"VipColor",dini_Int(GetViPFile(playerid),"VipColor"));
dini_IntSet(VF,"VipTag",dini_Int(GetViPFile(playerid),"VipTag"));
dini_Remove(GetViPFile(playerid));}
format(String1,sizeof(String1),"Mode/Users/%s.ini",newnick);
dini_Create(String1);
fcopy(GetPlayerFile(playerid),String1);
format(string, sizeof(string), " %s щок щерд бдцмзд м ", newnick);
SendClientMessage(playerid, COLOR_YELLOW, string);
for(new i = 0; i < GetMaxPlayers(); i++)if(IsPlayerConnected(i) && i != playerid)format(String,sizeof(String), "%s - щйрд аъ щое м %s", newnick,GetName(playerid)),SendClientMessage(i,COLOR_GREEN,String);
dini_Remove(GetPlayerFile(playerid));
SetPlayerName(playerid, newnick);
Kick(playerid);
return 1; }
Maybe you disconnect from server... And the server don't shutdown?