Hallo Liebe Leute also ich habe ein unban befehle im script und wenn ich ingame /unban schreibe Passiert nur das Unkown Command hier der Command
dcmd_unban(playerid, params[])
{
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Du bist nicht eingeloggt.");
if(PlayerInfo[playerid][pAdmin] <= 1999) return SendClientMessage(playerid, COLOR_WHITE, "Du bist kein Server-Owner/High-Admin.");
new accname[MAX_PLAYER_NAME];
if(sscanf(params, "s", accname)) return SendClientMessage(playerid, COLOR_WHITE, "Befehl: /unban [EXAKTER Accountname]");
new acc[MAX_PLAYER_NAME+20];
format(acc,sizeof(acc),"/Accounts/%s.ini",accname);
if(!fexist(acc)) {
format(stringx,sizeof(stringx)," Der Account %s existiert nicht!",accname);
SendClientMessage(playerid,COLOR_GRAD2,stringx);
return 1;
}
new File:banaccount = fopen(acc,io_write);
fwrite(banaccount,"Gesperrt=0\n");
fclose(banaccount);
format(stringx, sizeof(stringx), "AdmCmd: Admin %s hat %s entbannt!", MeinName(playerid), accname); ABroadCast(COLOR_LIGHTRED, stringx, 1);
return 1;
}
und mein bann befehle vielecht braucht ihr den!
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /ban [playerid] [grund]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /ban [playerid] [grund]");
return 1;
}
if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pSupporter])
{
SendClientMessage(playerid, COLOR_GRAD2, "Du kannst diesen Spieler nicht bannen, da er ein höheres Adminlevel hat als du!");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
//PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
PlayerInfo[giveplayerid][pGesperrt] = 1;
//Ban(giveplayerid);
Kick(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}