[Pomoc] Komanda /unban

Započeo Milan || WG, Mart 10, 2013, 22:05:59 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

 Skripta: CLRP
Problem: Pa ne unbana mi profil.. npr napravio sam da kad banam nekog igraca postavi mi pBanan == 1 i da se ne moze prikljucit na server, kako sad da napravim da kad kucam /unban nick da mu postavi pbanan == 0 ako moze neko pomoc?
Dio skripte:    if (strcmp(cmd, "/unban", true)==0)
   {
       if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=1337)
       {
           tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
         {
              SendClientMessage(playerid, COLOR_WHITE, ""svpl"Koriscenje:{FFFFFF} /unban [Ime_Prezime]");
               return 1;
          }
          GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
          GetPlayerName(playerid, sendername, sizeof(giveplayer));
          format(string, 256, ""COL_RED"| BC |{FFFFFF} %s je unbanovao %s", sendername, tmp);
          ABroadCast(COLOR_YELLOW,string,1);
         format(string, 256, ""COL_RED"| BC |{FFFFFF} %s je unbanovao %s", 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;
   }
Sliek// Video//

Vidi /unban je da unbanas igraca koji je dobio IP ban, a koliko ja znam obicna /ban komanda u CLRP daje pLocked 1... znaci tebi treba komanda /aunlock ;)

Da ja sma samo uveo novu varijablu pBanan ot je isto e sad unban za account da postavi pBanan == 0 ponovvo na nulu...

Evo ovako, fali mi ono da otvori njegov .ini i postavi varijablu.. al ovako bi kod trebao ici
Sacekaj da se sjetim kako to ide



if (strcmp(cmd, "/unban", true)==0)
    {
    if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=1337)
        {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
          {
          SendClientMessage(playerid, COLOR_WHITE, ""svpl"Koriscenje:{FFFFFF} /unban [Ime_Prezime]");
                return 1;
          }
          GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
          GetPlayerName(playerid, sendername, sizeof(giveplayer));
          format(string, 256, ""COL_RED"| BC |{FFFFFF} %s je unbanovao %s", sendername, tmp);
          ABroadCast(COLOR_YELLOW,string,1);
          format(string, 256, ""COL_RED"| BC |{FFFFFF} %s je unbanovao %s", sendername, tmp);
          printf(string);
          PlayerInfo[giveplayerid][pBanan] = 0;
          SendClientMessage(playerid, COLOR_WHITE, "Igrac je unbanovan");
          GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
          GetPlayerName(playerid, sendername, sizeof(sendername));
      }
      return 1;
    }

giveplayerid ? kad je igrac off kako giveplayerid on nema id ne moze se prikljucit

Evo provjerio sam ponovo ne radi..,.,.,.


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");
PlayerInfo[giveplayerid][pBanan] = 0;
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
}
return 1;
}


eto ubaci tako... =D I radit ce ...
Poslednja Izmena: Mart 11, 2013, 14:07:20 POSLE PODNE od _HarDy_
Moji Radiovi!
TuT||Iz code u MTA

Citat: _HarDy_ poslato Mart 11, 2013, 14:06:49 POSLE PODNE

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");
PlayerInfo[giveplayerid][pBanan] = 0;
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
}
return 1;
}


eto ubaci tako... =D I radit ce ...

Nece, to brise samo igraca sa "samp.ban" mape... On zeli da mu promijeni pBanan na 0 kada ukuca komandu, a to zahtijeva ucitavanje ini-a i sacuvanje.. Samo se ja ne mogu sjetiti kako to ide pa neka neko drugi onda to napravi umjesto mene :/