[Help] Server Closed The Connection
#1

I got Server Closed Connection when join in my server.



Under my Onplayerconnect(playerid)

PHP код:
public OnPlayerConnect(playerid)
{
    
// ban code
    
new Code[128], Line[256];
    
gpci(playerid, Code, sizeof Code);
    
format(Line, sizeof(Line), Location, Code);
    if(
fexist(Line)) return Kick(playerid);
    
    if(
InvalidName(GetName(playerid))) return s_BadNameMess(playerid);
     
ResetVar(playerid);
    
    
SMT(playerid,"~n~~g~~h~Selamat datang di~n~~w~"SERVER_NAME"~n~~r~~h~Robbers~w~/~b~~h~DM~w~/~y~~h~Race~w~/~p~~h~Freeroam");
    
    
// TextDraw player
    
LoadPayerTD(playerid);
    
    
SPVI(playerid,"FirstJoin",1);
    return 
1;
}
CekPlayerAKA(playerid)
{
    
// Aka system
    
new GoFile[100],pIP[16],Jstr[1080],Jstring[1080];
    
strdel(aka,0,256);
    
GetPlayerIp(playerid,pIP,16);
    
GetPlayerIp(playerid,playerIP,16);
    
format(GoFile,sizeof(GoFile),"ServerLogs/aka.ini");
    
INI_ParseFile(GoFile,"GetAkaLog");
    if(
strlen(aka) < 3)
    {
        
format(GoFile,sizeof(GoFile),"ServerLogs/aka.ini");
        new 
INI:AKA = INI_Open(GoFile);
        
INI_WriteString(AKA, pIP, GetName(playerid));
        
INI_Close(AKA);
    }
    else if(
strfind(aka, GetName(playerid), true) == -1)
    {
        
format(GoFile,sizeof(GoFile),"ServerLogs/aka.ini");
        
format(Jstr,sizeof(Jstr),"%s,%s", aka, GetName(playerid));
        new 
INI:AKA = INI_Open(GoFile);
        
INI_WriteString(AKA, pIP, Jstr);
        
INI_Close(AKA);
    }
    if(
strlen(aka) > 70)
    {
        
strmid(Jstring,aka,0,70);
        
format(Jstr, sizeof(Jstr),"Sign in >> Player: %s(%d) - IP: %s - AKA: %s", GetName(playerid),playerid,playerIP , Jstring);
        
MessAdmins(COLOR_TOMATO,Jstr);
        
strmid(Jstring,aka,70,sizeof(aka));
        
format(Jstr, sizeof(Jstr),"%s", Jstring);
        
MessAdmins(COLOR_TOMATO,Jstr);
    }
    else
    {
        if(
strlen(aka) > 2) format(Jstr, sizeof(Jstr),"Sign in >> Player: %s(%d) - IP: %s - AKA: %s", GetName(playerid),playerid,playerIP , aka);
        else 
format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: No aka found!", GetName(playerid),playerIP);
        
MessAdmins(COLOR_TOMATO,Jstr);
    }
    return 
1;
}
s_BadNameMess(playerid)
{
        new 
str[200], wlcm[500];
        
format(str,200,"{FF0000}|- %s[%d] telah otomatis di Kick. | Karena : Nick menggunakan symbol [] atau () -|",GetName(playerid),playerid);
        
SCMTA(-1,str);
           
strcat(wlcm,"{FFFF00}Mohon maaf, nama anda tidak valid !\n");
        
strcat(wlcm,"Silahkan anda relog ! Anda hanya bisa menggunakan 0-9 atau a-z atau atau $ atau . atau _ dan =\n");
        
strcat(wlcm,"Ini berfungsi agar tidak ada yang fake Group/Gang\n");
           
strcat(wlcm,"Anda bisa menggunakan nama seperti ini : [VG]Kirito ketika sudah memiliki Group/Gang!\n");
        
sDialog(playerid,"Server-Message",wlcm);
        
pKick(playerid);
        return 
1;
}
LoadPayerTD(playerid)
{
    
Money[playerid] = CreatePlayerTextDraw(playerid, 511.200500, 306.133697, "lol");
    
PlayerTextDrawLetterSize(playerid, Money[playerid], 0.440399, 2.749869);
    
PlayerTextDrawAlignment(playerid, Money[playerid], 1);
    
PlayerTextDrawColor(playerid, Money[playerid], -1);
    
PlayerTextDrawSetShadow(playerid, Money[playerid], 0);
    
PlayerTextDrawSetOutline(playerid, Money[playerid], 1);
    
PlayerTextDrawBackgroundColor(playerid, Money[playerid], 51);
    
PlayerTextDrawFont(playerid, Money[playerid], 3);
    
PlayerTextDrawSetProportional(playerid, Money[playerid], 1);
    
SendMessTD[playerid] = CreatePlayerTextDraw(playerid, 149.600021, 383.787200, "Sorry your slot has benn full . okay ? Mengerti ka ?");
    
PlayerTextDrawLetterSize(playerid, SendMessTD[playerid], 0.304399, 1.241599);
    
PlayerTextDrawAlignment(playerid, SendMessTD[playerid], 1);
    
PlayerTextDrawColor(playerid, SendMessTD[playerid], -1);
    
PlayerTextDrawSetShadow(playerid, SendMessTD[playerid], 0);
    
PlayerTextDrawSetOutline(playerid, SendMessTD[playerid], 1);
    
PlayerTextDrawBackgroundColor(playerid, SendMessTD[playerid], 51);
    
PlayerTextDrawFont(playerid, SendMessTD[playerid], 1);
    
PlayerTextDrawSetProportional(playerid, SendMessTD[playerid], 1);
    
    for(new 
td = 0; td < 5; td++)
    {
        
TextDrawShowForPlayer(playerid, ServerTD[td]);
    }
    return 
1;
}
ResetVar(playerid)
{
    
pInfo[playerid][Baned]      = 0;
    
pInfo[playerid][MostScore]  = 0;
    
pInfo[playerid][Login]      = 0;
    
pInfo[playerid][pFish]      = 0;
    
pInfo[playerid][Fishing]    = 0;
    
pInfo[playerid][Admin]         = 0;
    
pInfo[playerid][Minigame]     = 0;
    
pInfo[playerid][VIP]         = 0;
    
pInfo[playerid][pMoney]     = 0;
    
pInfo[playerid][VgCash]     = 0;
    
pInfo[playerid][TotalScore] = 0;
    
pInfo[playerid][ShootWarn]  = 0;
    
pInfo[playerid][DuelScore]     = 0;
    
pInfo[playerid][Color]      = -1;
    
pInfo[playerid][Skin]          = -1;
    
pInfo[playerid][Deaths]     = 0;
    
pInfo[playerid][MinigameUsed] = 0;
    
pInfo[playerid][TopDm]      = 0;
    
pInfo[playerid][JailTime]    = 0;
    
pInfo[playerid][InJail]     = 0;
    
KillTimer(pInfo[playerid][JailTimer]);
    
pInfo[playerid][ToppDuel]    = 0;
    
pInfo[playerid][GetMoney]     = 0;
    
pInfo[playerid][ToppJob]     = 0;
    
pInfo[playerid][ToppRob]    = 0;
    
pInfo[playerid][Kills]         = 0;
    
pInfo[playerid][RobScore]   = 0;
    
pInfo[playerid][RaceScore]   = 0;
    
pInfo[playerid][MbScore]    = 0;
    
pInfo[playerid][PTScore]    = 0;
    
pInfo[playerid][KillsCount]    = 0;
    
pInfo[playerid][Dinviter]    = -1;
    
pInfo[playerid][InDuel]        = -1;
    
pInfo[playerid][DuelType]     = -1;
    
pInfo[playerid][TeleUsed]     = 0;
    
pInfo[playerid][InWar]      = 0;
    
pInfo[playerid][WarInvite]  = -1;
    
pInfo[playerid][gID]          = 0;
    
pInfo[playerid][gLevel]      = 0;
    
pInfo[playerid][SpawnAt]    = 1;
    
pInfo[playerid][pArmour]    = 0.0;
    
pInfo[playerid][pHealth]    = 0.0;
    
pInfo[playerid][Warnings]   = 0;
    
pInfo[playerid][AntiSpawn]     = 0;
    
pInfo[playerid][Password]   = 0;
    
pInfo[playerid][ID]         = 0;
    
pInfo[playerid][hours]        = 0;
    
pInfo[playerid][mins]        = 0;
    
pInfo[playerid][secs]        = 0;
    
pInfo[playerid][TotalTime]  = 0;
    
pInfo[playerid][ConnectTime]= gettime();
    
    
pInfo[playerid][MuteWarnings]     = 0;
    
pInfo[playerid][Muted]           = 0;
    
pvehicleid[ playerid ]         = GetPlayerVehicleID( playerid );
    
pvehicleid[ playerid ]         = 0;
    
pmodelid[ playerid ]         = 0;
    
pInfo[playerid][gPlayerUsingLoopingAnim]  = 0;
    
pInfo[playerid][gPlayerAnimLibsPreloaded] = 0;
    
pInfo[playerid][gID]         = 0;
    
pInfo[playerid][gLevel]     = 0;
    
    
pInfo[playerid][PlayerEnterTime]+=221;
    
    
SetPVarInt(playerid,"GroupInvite",-1);
    
SetPVarInt(playerid,"mGameType",-1);
    
SetPVarInt(playerid,"DuelTarget",-1);
    
    
SPVI(playerid,"GOS",1);
        
    
DestroyDynamic3DTextLabel(pInfo[playerid][MWTD]);
    return 
1;
} 
What its the problem?

#Sorryformybadengish
Reply
#2

Does it happen as soon as the dialog loads? Can you post up the dialog parts as well?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)