hm also ich stelle mal das jetzige /ban rein vlt. hilfts ja
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /ban [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2)
{
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, "Verwendung: /ban [playerid/PartOfName] [reason]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "UserBan: %s wurde von %s gebannt!, Grund: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
format(string, sizeof(string), "UserBan: %s wurde von %s gebannt!, Grund: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pLevel] = -999;
PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), " %d Ist kein Aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}