24.06.2015, 20:08
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
Under on my OnPlayerRequestClass
How to fix my problem ?
#Sorry for my bad english
I am really need help guys
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 = 0; td < 5; td++)
{
TextDrawShowForPlayer(playerid, ServerTD[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(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);
}
// Create stunt island objects for the player
CreateSIObjects(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);
return 1;
}
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
if(pInfo[playerid][Login] == 0) // This will show Dialog Login/Register
{
new query[500];
GetPlayerIp(playerid, IP[playerid], 16);
mysql_format(mysql, query, sizeof(query),"SELECT `Password`, `ID`, `Baned`, `BanedReason` FROM `players` WHERE `Username` = '%e' LIMIT 1", GetName(playerid));
mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
}
// business
pInfo[playerid][CurrentBusiness] = 0;
// houses
pInfo[playerid][CurrentHouse] = 0;
SetPlayerPos(playerid, 2082.128173, 1187.398803, 10.820312);
SetPlayerFacingAngle(playerid, 49.730384);
SetPlayerCameraLookAt(playerid, 2082.128173, 1187.398803, 10.820312);
SetPlayerCameraPos(playerid, 2082.128173 + (5 * floatsin(-49.730384, degrees)), 1187.398803 + (5 * floatcos(-49.730384, degrees)), 10.820312);
GameTextForPlayer(playerid,"~<~ ~g~~h~Pilih Skin ~>~",3000,4);
// Play sound
PlayerPlaySound(playerid, SERVER_SOUND, 0.0, 0.0, 10.0);
// MYSQL
//if(pInfo[playerid][Login] == 0) return CekPlayer(playerid);
return 1;
}
#Sorry for my bad english
I am really need help guys