[pomoc] CMD ban

Započeo _HarDy_, Septembar 02, 2012, 14:59:46 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim : CLRP
Problem : e vako kada nekoga banam , nemogu unban , kucam /unban I ime , ali kada kucam to ja mogu bilo koje ime , npr kucam "/unban 111 , pise mi unbanali ste 111
A taj acc i nema xD

I sada ja upisem ime  dobro , i onda on moze uci , ali mu pise da je acc zakljucan , i sada ja pisem
/aunlock , i pise da "koristite /aunlock [id / dio imena] , ja kucam /aunlock  Branko_Djukic (npr)
I nista mi ne pise ni da sam otkljucao nit ista , i onda on nemoze uci :S
Dio skripte :

if(strcmp(cmd,"/unbanip",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid,COLOR_GRAD1,"Koriscenje: /unbanip [igraceva ip]");
        return 1;
    }
format(string,sizeof(string),"unbanip %s",tmp);
SendRconCommand(string);
SendRconCommand("reloadbans");
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "[ADMIN] %s je unbanovao IP %s", sendername,tmp);
ABroadCast(COLOR_YELLOW,string,1);
}
return 1;
}
if (strcmp(cmd, "/unban", true)==0)
{
    if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=1337)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
{
        SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /unban [Ime_Prezime]");
            return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(giveplayer));
format(string, 256, "[ADMIN] %s je unbanovao %s-a", sendername, tmp);
ABroadCast(COLOR_YELLOW,string,1);
format(string, 256, "[ADMIN] %s je unbanovao %s-a", sendername, tmp);
printf(string);
format(string,sizeof(string),"%s.ini",tmp);
fremove(string);
SendClientMessage(playerid, COLOR_WHITE, "Igrac je unbanovan");
SendRconCommand(string);
SendRconCommand("reloadbans");
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
}
return 1;
}



/aunlock

if(strcmp(cmd, "/aunlock", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pGameSage] >= 4)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /aunlock [ID Igraca/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(PlayerInfo[giveplayerid][pLocked] == 1)
        {
            PlayerInfo[giveplayerid][pLocked] = 0;
            TogglePlayerControllable(giveplayerid, 1);
            SendClientMessage(playerid, COLOR_YELLOW, "Account je uspjesno otkljucan.");

        }
    }
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Morate biti barem admin lvl 3 za koriscenje ove komande.");
}
return 1;
}


Slika / video: /
Moji Radiovi!
TuT||Iz code u MTA


Ta /aunlock komanda je najgluplja komanda koju sam ikad video, mslm sluzi da unbanas igraca (da mu dozvolis da UDJE u igru) a mora biti online da bi mogao da ga otkljucas LOL... jednostavno makni deo gde mu stavlja zakljucavanje :S

Pogledajte , evo kako cu to izbaciti ? :S
I jeli ovo dobro sto su komande nekako spojene ova banip i ban ? (mozda glupo pitanje al pocetnik sam ;) )


if(strcmp(cmd, "/banip", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
        new playersip[64];
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /banip [ID Igraca/Dio Imena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
    if(IsPlayerConnected(giveplayerid))
    {
if(PlayerInfo[giveplayerid][pAdmin] >= 1338)
{
SendClientMessage(playerid, COLOR_WHITE, " Pokusaj BANA Admina veceg levela nije uspjelo!");
return 1;
}
        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_GRAD2, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
return 1;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
SendClientMessage(giveplayerid,COLOR_NICERED, "____________________________________________________________________________________");
SendClientMessage(giveplayerid,COLOR_LIGHTRED, "VASA IP ADRESA JE BANANA !");
format(string,sizeof(string), "%s (ID: %d) -ova IP adresa je Banana sa servera od %s",giveplayer, giveplayerid, sendername);
SendClientMessage(giveplayerid, COLOR_NICERED, string);
BanLog(string);
format(string,sizeof(string), "Razlog iskljucenja: %s ", (result));
SendClientMessage(giveplayerid, COLOR_NICERED, string);
BanLog(string);
format(string,sizeof(string), "Datum i vrijeme bana: Dana: %d/%d/%d, Sati: %d:%d:%d | Vasa IP Adresa je: %s ",d,m,y,h,mi,s, playersip);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_WHITE, "Sa ovim banom, niste u mogucnosti pristupiti serveru!");
SendClientMessage(giveplayerid,COLOR_ORANGE, "Ukoliko mislis da je doslo do greske slikaj ovo(f8) i zatrazi unban na forumu!");
SendClientMessage(giveplayerid,COLOR_NICERED, "____________________________________________________________________________________");
format(string, sizeof(string), "Ban | {FFFFFF}%s | Admin: %s | Razlog: "COL_RED"%s {FFFFFF}(Dana: %d/%d/%d | Sati: %d:%d:%d)", giveplayer, sendername, (result),d,m,y,h,mi,s);
ABroadCast(NICERED,string,1);
format(string, sizeof(string), "Ban | {FFFFFF}%s | {F81414}Admin: {FFFFFF}%s", giveplayer, sendername);
SendClientMessageToAll(NICERED, string);
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Moji Radiovi!
TuT||Iz code u MTA