15.07.2015, 20:52
PHP код:
function: CheckPlayerBan(playerid)
{
new Query[300];
SendClientMessage(playerid,-1, "Checando Listas de banidos...");
print("erro 1"); //bug
format(Query, sizeof(Query), "SELECT * FROM `banidos` WHERE `nome` = '%s'", GetNome(playerid));
mysql_function_query(mysql, Query, true, "r@CheckPlayerBan", "i", playerid);
print("erro 2");
return 1;
}
function: r@CheckPlayerBan(playerid)
{
new Rows,
Fields,
Pegar[32],
Printar[290];
cache_get_data(Rows,Fields,mysql);
cache_get_field_content(0,"nome",Pegar,mysql);
format(Pegar, 24, "%s", Banidos[playerid][NomeBan]);
cache_get_field_content(0,"admin",Pegar,mysql);
format(Pegar, 24, "%s", Banidos[playerid][AdminBan]);
cache_get_field_content(0,"motivo",Pegar,mysql);
format(Pegar, 45, "%s", Banidos[playerid][Motivo]);
cache_get_field_content(0,"data",Pegar,mysql);
format(Pegar, 10, "%s", Banidos[playerid][Data]);
cache_get_field_content(0,"hora",Pegar,mysql);
format(Pegar, 10, "%s", Banidos[playerid][Hora]);
if(!strcmp(Banidos[playerid][NomeBan],GetNome(playerid),false))
{
print("chegou aqui");
format(Printar,sizeof(Printar),"{FFFFFF}Vocк esta Banido...!\nMotivo do Banimento: {FF8200}%s{FFFFFF}\nAdmin responsavel: {FF8200}%s{FFFFFF}\nData: {FF8200}%s{FFFFFF}\nHorбrio: {FF8200}%s\n{FFFFFF}Atenciosamente: Equipe Trucking Live™",
Banidos[playerid][Motivo],Banidos[playerid][AdminBan],Banidos[playerid][Data],Banidos[playerid][Hora]);
ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX,"{FFFFFF}Banido",Printar,"Confirmar","");
printf("Nome: %s |Admin: %s |Motivo: %s |data %s |hora %s",Banidos[playerid][NomeBan],Banidos[playerid][AdminBan],Banidos[playerid][Motivo],
Banidos[playerid][Data],Banidos[playerid][Hora]);
Kicka(playerid);
return 1;
}
SendClientMessage(playerid,-1," ");
SendClientMessage(playerid,-1," ");
return 1;
}