01.12.2015, 22:23
So this is my ban system now. But I would like to change it to a new on where it grabs from another table how would i do this.
Here is the query under onplayerconnect
here is the thread
here is the table i would like it to grab from

it currently grabs from the players table but I would like it to grab the ban information from the BannedGameAccounts table
Here is the query under onplayerconnect
Код:
mysql_format(mysql, query, sizeof(query),"SELECT `Pass`, `ID` FROM `players` WHERE `User` = '%e' LIMIT 1", GetUserName(playerid));
mysql_tquery(mysql, query, "SQL_Account_Check", "i", playerid);
Код:
forward SQL_Account_BanCheck(playerid);
public SQL_Account_BanCheck(playerid)
{
new string[70];
if(Player[playerid][AccountLocked])
{
format(string, sizeof(string), "Your account has been locked. Please head to ---");
if(Player[playerid][AccountBanned])
{
format(string, sizeof(string), "Your account is banned. Banning administrator: %s", Player[playerid][BanningAdmin]);
SendClientMessage(playerid, COLOR_ERROR, string);
format(string, sizeof(string), "Banning reason: %s", Player[playerid][BannedReason]);
SendClientMessage(playerid, COLOR_ERROR, string);
}
SendClientMessage(playerid, COLOR_ERROR, string);
SetTimerEx("KickPlayer", 1000, false, "i", playerid);
}
else if(!Player[playerid][AccountLocked])
{
TogglePlayerSpectating(playerid, false);
SetSpawnInfo(playerid, 0, Player[playerid][SkinID], SERVER_SPAWN_X, SERVER_SPAWN_Y, SERVER_SPAWN_Z, SERVER_SPAWN_A, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetCameraBehindPlayer(playerid);
}
return true;
}

it currently grabs from the players table but I would like it to grab the ban information from the BannedGameAccounts table


+rep