[POMOC] Ban.

Započeo Harrson, Maj 27, 2012, 20:00:05 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: Moj mod od 0.
Detaljan opis problema: Hocu da znam, ili ko da mi naprevi da mogu banati na vrjeme na primjer: /ban [ID/Ime] [0-21 Dana] [Razlog]... I takodje da mogu unbanati.
Dio skripte: Dole.
Neke slike/video za lakse dobivanje pomoci(neobavezno): Dole.

   if(strcmp(cmd, "/ban", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
            new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /ban [ID/DioImena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pGameMaster] >= 3 || IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid != INVALID_PLAYER_ID)
        {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
        SendClientMessage(playerid, COLOR_DGOLD, "Koristi: /ban [ID/DioImena] [razlog]");
return 1;
}
new targetlevel = PlayerInfo[giveplayerid][pAdmin] > 0;
new playerlevel = PlayerInfo[playerid][pAdmin] > 0;
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Nemozes banati veci adm lvl od sebe.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string), "%s je dobio ban od %s.Razlog: %s" , giveplayer,sendername, (result));
BanLog(string);
format(string, sizeof(string), "SERVER: %s je dobio ban od %s.Razlog: %s.", giveplayer,  sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(string, sizeof(string), "[BAN LOG]: %s je stavljen u listu bananih od strane administratora %s", playersip, sendername);
SendAdminMessage(COLOR_YELLOW, string);
ClearChatbox(giveplayerid, 100);
new y, m, d;
    new h,mi,s;
    getdate(y,m,d);
    gettime(h,mi,s);
                        format(string, sizeof(string), "----------------------------------------------[BAN]--------------------------------------------", sendername );
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "SERVER: Dobili ste ban od Administratora %s", sendername);
SendClientMessage(giveplayerid,COLOR_WHITE, string);
format(string, sizeof(string), "RAZLOG: %s.", (result));
SendClientMessage(giveplayerid,COLOR_WHITE, string);
format(string, sizeof(string), "VRIJEME & DATUM: (%d/%d/%d) - [%d:%d:%d].", d,m,y,h,mi,s);
SendClientMessage(giveplayerid,COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_WHITE, "SERVER: Ako mislite da je doslo do greske obratite se na forumu.");
SendClientMessage(giveplayerid,COLOR_WHITE, "SERVER: Vas East Balkan Admin Team");
                        format(string, sizeof(string), "------------------------------------------------------------------------------------------------", sendername );
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "ERROR: Igrac %d trenutno nije online.", giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
}
}
return 1;
}


I kod Unbana, necu banati IP, nego samo Ingame Account. Takodje i Unban ingame direktno. ukucam /unban [Ime] i unbanam ga i more odma unic bez gmx-a.

   if (strcmp(cmd, "/unban", true)==0)
{
    if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=1337)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
{
        SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /unban [Ime_Prezime]");
            return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(giveplayer));
format(string, 256, "Administrator %s je unbano Igraca %s.", sendername, tmp);
ABroadCast(COLOR_YELLOW,string,1);
format(string, 256, "Administrator %s je unbano Igraca %s.", sendername, tmp);
printf(string);
format(string,sizeof(string),"%s.ini",tmp);
fremove(string);
SendClientMessage(playerid, COLOR_GOLD, "INFO: Uspjenso ste unbanovali Igraca");
SendRconCommand(string);
SendRconCommand("reloadbans");
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
}
return 1;
}

Sorry za DP ali vazno je.

Zna li neko ?