forward Banned(playerid);
public Banned(playerid)
{
if(IsPlayerConnected(playerid))
{
for(new i=0;i<GetMaxPlayers();i++)
{
new Nome[MAX_PLAYER_NAME];
new sql[1024];
new pIP[16];
GetPlayerName(i, Nome, sizeof(Nome));
GetPlayerIp(i,pIP,sizeof(pIP));
format(sql,sizeof(sql), "SELECT * FROM `bans` WHERE `name` = '%s' OR `IP`='%s'",Nome,pIP);
mysql_function_query(mysql, sql, false,"isBanned","d",i);
}
}
else
{
}
}
forward isBanned(playerid);
public isBanned(playerid)
{
new rows, fields;
cache_get_data(rows, fields,mysql);
if(rows){
if(IsPlayerConnected(playerid))
{
new Nome[MAX_PLAYER_NAME];
new Titulo[256],Info[256];
GetPlayerName(playerid,Nome,sizeof(Nome));
new values[3];
cache_get_field_content(playerid, "name", values[0], mysql);
BanInfo[playerid][name] = strval(values[0]);
cache_get_field_content(playerid, "reason", values[1], mysql);
BanInfo[playerid][rasao] = strval(values[1]);
cache_get_field_content(playerid, "admin", values[2], mysql);
BanInfo[playerid][admin] = strval(values[2]);
format(Titulo,sizeof(Titulo), "Vocк estб banido");
format(Info,sizeof(Info),"Olб vocк esta Banido !\nNome da conta : %s\nRasгo %s\nNome do Admin %s",values[0],values[1],values[2]);
ShowPlayerDialog(playerid,Dialog_Ban, DIALOG_STYLE_MSGBOX, Titulo, Info, "Ok","");
SetTimerEx("KickWithMessage", 500, 0,"");
}
else
{
SendClientMessage(playerid,-1, "Jogador nгo esta online para receber o ban.");
}
}else{
}
}
forward isBanned(playerid);
public isBanned(playerid) {
new rows, fields;
cache_get_data(rows, fields,mysql);
if(rows){
new Nome[MAX_PLAYER_NAME];
new Titulo[256],Info[256];
GetPlayerName(playerid,Nome,sizeof(Nome));
cache_get_field_content(playerid, "name", BanInfo[playerid][name], mysql);
cache_get_field_content(playerid, "reason", BanInfo[playerid][rasao] mysql);
cache_get_field_content(playerid, "admin", BanInfo[playerid][admin], mysql);
format(Titulo,sizeof(Titulo), "Vocк estб banido");
format(Info,sizeof(Info),"Olб vocк esta Banido !\nNome da conta : %s\nRasгo %s\nNome do Admin %s",BanInfo[playerid][name], BanInfo[playerid][rasao],BanInfo[playerid][admin]);
ShowPlayerDialog(playerid,Dialog_Ban, DIALOG_STYLE_MSGBOX, Titulo, Info, "Ok","");
SetTimerEx("KickWithMessage", 500, 0,"");
}
else
SendClientMessage(playerid, -1, "Vocк nгo estб banido!");
}
forward isBanned(playerid);
public isBanned(playerid) {
new rows, fields;
cache_get_data(rows, fields,mysql);
if(rows){
new Nome[MAX_PLAYER_NAME];
new Titulo[256],Info[256];
GetPlayerName(playerid,Nome,sizeof(Nome));
cache_get_field_content(playerid, "name", BanInfo[playerid][name], mysql);
cache_get_field_content(playerid, "reason", BanInfo[playerid][rasao] mysql);
cache_get_field_content(playerid, "admin", BanInfo[playerid][admin], mysql);
format(Titulo,sizeof(Titulo), "Vocк estб banido");
format(Info,sizeof(Info),"Olб vocк esta Banido !\nNome da conta : %s\nRasгo %s\nNome do Admin %s",BanInfo[playerid][name], BanInfo[playerid][rasao],BanInfo[playerid][admin]);
ShowPlayerDialog(playerid,Dialog_Ban, DIALOG_STYLE_MSGBOX, Titulo, Info, "Ok","");
SetTimerEx("KickWithMessage", 500, 0,"");
}
else
SendClientMessage(playerid, -1, "Vocк nгo estб banido!");
}
enum {
name[21],
reason[50],
admin[21]
}
forward isBanned(playerid);
public isBanned(playerid) {
new rows, fields;
cache_get_data(rows, fields,mysql);
if ( rows ){
new Nome[MAX_PLAYER_NAME];
new Info[256], admin[MAX_PLAYER_NAME], motivo[64];
GetPlayerName(playerid,Nome,sizeof(Nome));
cache_get_field_content(0, "reason", motivo, mysql);
cache_get_field_content(0, "admin", admin, mysql);
format(Info,sizeof(Info),"Olб vocк esta Banido !\nNome da conta : %s\nRasгo %s\nNome do Admin %s",Nome, motivo, admin);
ShowPlayerDialog(playerid,Dialog_Ban, DIALOG_STYLE_MSGBOX, "Vocк estб banido", Info, "Ok","");
SetTimerEx("KickWithMessage", 500, 0,"");
}
return 1;
}
pawn Код:
|