Hallo also ich habe ein acc ban befehle drin aber es funktioniert nicht also wenn ich es ingame eingebe geht es nicht?? hilfe
if(strcmp(cmd, "/accban", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
//giveplayer = strtok(cmdtext, idx);
if(!strlen(giveplayer))
{
SendClientMessage(playerid,COLOR_GRAD2,"FEHLER: /accban [AccountName] (Korrekte Schreibweise erforderlich)");
return 1;
}
new acc[64], acc2[64], year, month, day, readstr[128];
format(acc,sizeof(acc),"/Accounts/%s.ini",giveplayer);
format(acc2,sizeof(acc2),"/Accounts/%s.backup",giveplayer);
if(!fexist(acc))
{
format(string,sizeof(string)," Der Account von %s existiert nicht!",giveplayer);
SendClientMessage(playerid,COLOR_GRAD2,string);
return 1;
}
new File:account = fopen(acc,io_read);
new File:backup = fopen(acc2,io_write);
while(fread(account,readstr))
{
fwrite(backup,readstr);
}
fclose(backup);
fclose(account);
//new File:banaccount = fopen(acc,io_write);
//fwrite(banaccount,"Level=-999\n");
//fclose(banaccount);
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s's Account wurde von %s gebannt! (%d-%d-%d)",giveplayer,sendername,month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s's Account wurde von %s gebannt!",giveplayer,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
PlayerInfo[giveplayerid][pGesperrt] = 1;
Kick(giveplayerid);
}
return 1;
}