[HELP] Auto spawn under Onplayerconnect ?
#1

I am join in my server when under onplayerconnect i got auto spawn and get kick.
Because Under OnplayerSpawn(playerid) i make if who not loggedin and click spawn in OnPlayerRequestClass will return get Kick from server.


How to stop it ?

Btw this my script under oplayerconnect
PHP код:
public OnPlayerConnect(playerid)
{
    
ResetVar(playerid);
    if(
InvalidName(GetName(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;
    }
    
    
ResetPlayerMoney(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);
    for(new 
td 0td 5td++)
    {
        
TextDrawShowForPlayer(playeridServerTD[td]);
    }
    
    
// 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(AKApIPGetName(playerid));
        
INI_Close(AKA);
    }
    else if(
strfind(akaGetName(playerid), true) == -1)
    {
        
format(GoFile,sizeof(GoFile),"ServerLogs/aka.ini");
        
format(Jstr,sizeof(Jstr),"%s,%s"akaGetName(playerid));
        new 
INI:AKA INI_Open(GoFile);
        
INI_WriteString(AKApIPJstr);
        
INI_Close(AKA);
    }
    if(
strlen(aka) > 70)
    {
        
strmid(Jstring,aka,0,70);
        
format(Jstrsizeof(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(Jstrsizeof(Jstr),"%s"Jstring);
        
MessAdmins(COLOR_TOMATO,Jstr);
    }
    else
    {
        if(
strlen(aka) > 2format(Jstrsizeof(Jstr),"Sign in >> Player: %s(%d) - IP: %s - AKA: %s"GetName(playerid),playerid,playerIP aka);
        else 
format(Jstrsizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: No aka found!"GetName(playerid),playerIP);
        
MessAdmins(COLOR_TOMATO,Jstr);
    }
    
    
// Create stunt island objects for the player
    
CreateSIObjects(playerid);
    
    
// ban code
    
new Code[128], Line[256];
    
gpci(playeridCodesizeof Code);
    
format(Linesizeof(Line), LocationCode);
    if(
fexist(Line)) return Kick(playerid);
    return 
1;

Under on my OnPlayerRequestClass
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    if(
pInfo[playerid][Login] == 0// This will show Dialog Login/Register
    
{
        new 
query[500];
           
GetPlayerIp(playeridIP[playerid], 16);
           
mysql_format(mysqlquerysizeof(query),"SELECT `Password`, `ID`, `Baned`, `BanedReason` FROM `players` WHERE `Username` = '%e' LIMIT 1"GetName(playerid));
           
mysql_tquery(mysqlquery"OnAccountCheck""i"playerid);
    }
    
// business
    
pInfo[playerid][CurrentBusiness] = 0;
    
// houses
    
pInfo[playerid][CurrentHouse] = 0;
    
SetPlayerPos(playerid2082.1281731187.39880310.820312);
    
SetPlayerFacingAngle(playerid49.730384);
    
SetPlayerCameraLookAt(playerid2082.1281731187.39880310.820312);
    
SetPlayerCameraPos(playerid2082.128173 + (floatsin(-49.730384degrees)), 1187.398803 + (floatcos(-49.730384degrees)), 10.820312);
    
GameTextForPlayer(playerid,"~<~ ~g~~h~Pilih Skin ~>~",3000,4);
    
// Play sound
    
PlayerPlaySound(playeridSERVER_SOUND0.00.010.0);
    
// MYSQL
    //if(pInfo[playerid][Login] == 0) return CekPlayer(playerid);
    
return 1;

How to fix my problem ?

#Sorry for my bad english
I am really need help guys
Reply


Messages In This Thread
[HELP] Auto spawn under Onplayerconnect ? - by VenomMancer - 24.06.2015, 20:08
Re: [HELP] Auto spawn under Onplayerconnect ? - by Shetch - 24.06.2015, 20:15
Re: [HELP] Auto spawn under Onplayerconnect ? - by VenomMancer - 24.06.2015, 20:26
Re: [HELP] Auto spawn under Onplayerconnect ? - by VenomMancer - 25.06.2015, 03:38
Re: [HELP] Auto spawn under Onplayerconnect ? - by NeilC - 25.06.2015, 09:53
Re: [HELP] Auto spawn under Onplayerconnect ? - by FailerZ - 25.06.2015, 10:22

Forum Jump:


Users browsing this thread: 1 Guest(s)