Okay so I found it under
Код:
Onplayerconnect
ExistAccount(playerid);
and I moved it under OnplayerSpawn
....Here is what in side the existaccount
Код:
stock ExistAccount(playerid)
{
#if USE_MYSQL == true
new query[128];
format(query, sizeof(query), "SELECT * FROM `"#MYSQL_TABLE"` WHERE `PlayerName` = '%s'", GetName(playerid));
if(mysql_ping(gSQL))
{
mysql_query(query, _THREAD_ACCOUNT_EXIST, playerid, gSQL);
}
#else
new file[128];
format(file, sizeof(file), "/%s/%s.ini", DINI_PATH, GetName(playerid));
if(dini_Exists(file))
{
if(IsPlayerDiniBanned(playerid))
{
new string[128];
format(string, sizeof(string), ""red"Your account has been banned!"white"\n\nBanned by:\t %s\nReason:\t %s\nBan Date:\t %s", dini_Get(file, "BannedBy"), dini_Get(file, "BanReason"), dini_Get(file, "BanDate"));
ShowPlayerDialog(playerid, BAN_DIALOG, DIALOG_STYLE_MSGBOX, " ", string, "OK", "");
KickEx(playerid);
}
else
{
#if USE_AUTO_LOGIN == true
new lastusedIP[16], IP[16];
GetPlayerIp(playerid, IP, sizeof(IP));
format(lastusedIP, sizeof(lastusedIP), "%s", dini_Get(file, "LastIP"));
if(!strcmp(IP, lastusedIP, true))
{
SendClientMessage(playerid, GREEN, "SERVER: You will get auto logged in now");
LoadPlayer(playerid);
LogPlayerIn(playerid);
SendClientMessage(playerid, GREEN, "You have been automatically logged in");
}else ShowPlayerLoginDialog(playerid);
#else
ShowPlayerLoginDialog(playerid);
#endif
}
}
else
{
ShowPlayerRegisterDialog(playerid);
}
#endif
return 1;
}
So the question is. Do you think when I put this ExistAccount OnPlayerSpawn it will have a problem or conflict wtih ban?