Jump to content
  • 0

Cerere Ajutor problema /ban


xt3z0ne

Question

Nick:[sLG]Johnny...

Problema:pai am modificat nitel comanda ban dar atunci cand o pun imi da erori dar daca sterge erorile alea lante nu mai merge /duel si mai multe

Erori / warnings:[pawn]

D:\Games\RRS\filterscripts\LuxAdmin.pwn(1161) : warning 219: local variable "playername" shadows a variable at a preceding level

D:\Games\RRS\filterscripts\LuxAdmin.pwn(4523) : warning 219: local variable "playername" shadows a variable at a preceding level

D:\Games\RRS\filterscripts\LuxAdmin.pwn(4663) : warning 219: local variable "playername" shadows a variable at a preceding level

D:\Games\RRS\filterscripts\LuxAdmin.pwn(4754) : warning 219: local variable "playername" shadows a variable at a preceding level

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5613) : error 017: undefined symbol "tmp"

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5613) : error 017: undefined symbol "strtok"

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5614) : error 017: undefined symbol "tmp"

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5620) : error 017: undefined symbol "PlayerBanned"

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5620) : warning 215: expression has no effect

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5620) : error 001: expected token: ";", but found "]"

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5620) : error 029: invalid expression, assumed zero

D:\Games\RRS\filterscripts\LuxAdmin.pwn(5620) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

7 Errors.

[/pawn]

Lini/script:Nu este nevoie de linie pentru ca este dela comanda ban.

Ai incercat sa rezolvi singur ?:Da am incercat si nmk .

Comanda

[pawn]

CMD:ban(playerid,params[])

  {

      new name[MAX_PLAYER_NAME];

      if(AccInfo[playerid][Level] >= 4)

        {

        tmp = strtok(cmdtext,idx);

        if(!strlen(tmp))

        {

              SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Day(s)] [Reason]");

            SendClientMessage(playerid, orange, "Function: Temporarily bans a player for specified Days");

            return 1;

        }

        if(PlayerBanned[playerid] == -1)//report timer

            {

              SendClientMessage(playerid,COLOR_RED,"Poti da /ban doar o data la 3 minute!");

              return 1;

            }

            giveplayerid = ReturnUser(tmp);

        if(IsPlayerConnected(giveplayerid))

        {

            tmp = strtok(cmdtext, idx);

            if (!strlen(tmp))

            {

            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Day(s)] [Reason]");

            SendClientMessage(playerid, orange, "Function: Temporarily bans a player for specified Days");

            return 1;

            }

            new days = strval(tmp);

            if(!IsNumeric(tmp))

            return SendClientMessage(playerid, lightred, "ERROR: Invalid Day! Only Numbers!");

            if(strval(tmp) <= 0 || strval(tmp) > 1000)

            return SendClientMessage(playerid, lightred, "ERROR: Invalid Day! (1-1000)");

            new reason[128];

            reason = strtok2(cmdtext,idx);

            if (!strlen(reason))

            return SendClientMessage(playerid, lightred, "ERROR: Reason not Specified!");

            if (strlen(reason) <= 0 || strlen(reason) > 100)

            return SendClientMessage(playerid, lightred, "ERROR: Invalid Reason length!");

            GetPlayerName(playerid, name, sizeof name);

            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

            new File:tempban = fopen("TempBans.ban", io_append);

            if (tempban)

            {

                new year,month,day;

                getdate(year, month, day);

                day += days;

                if (IsMonth31(month))

                {

                    if (day > 31)

                    {

                        month += 1;

                        if (month > 12)

                        {

                            year += 1;

                            while(day > 31) day -= 31;

                        }

                        else while(day > 31) day -= 31;

                    }

                }

                else if (!IsMonth31(month))

                {

                    if (day > 30)

                    {

                        month += 1;

                        if (month > 12)

                        {

                            year += 1;

                            while(day > 30) day -= 30;

                        }

                        else while(day > 30) day -= 30;

                    }

                }

                else if (!IsMonth31(month) && IsMonth29(year) && month == 2)

                {

                    if (day > 29)

                    {

                        month += 1;

                        if (month > 12)

                        {

                            year += 1;

                            while(day > 29) day -= 29;

                        }

                        else while(day > 29) day -= 29;

                    }

                }

                else if (!IsMonth31(month) && !IsMonth29(year) && month == 2)

                {

                    if (day > 28)

                    {

                        month += 1;

                        if (month > 12)

                        {

                            year += 1;

                            while(day > 28) day -= 28;

                        }

                        else while(day > 28) day -= 28;

                    }

                }

                format(string, sizeof string, "%d|%d|%d|%s\n", day, month, year, giveplayer);

                fwrite(tempban, string);

                fclose(tempban);

            }

            new y,m,d;

            getdate(y,m,d);

            format(string,128,"|- AdmCmd: %s Banned %s for %d Day(s) | Reason: %s -|",name,giveplayer,days,reason);

            SendClientMessageToAll(COLOR_LIGHTRED,string);

            Kick(giveplayerid);

            format(string, sizeof string, "(%d-%d-%d)AdmCmd: Admin %s Banned %s for %d Day(s) | Reason: %s",d,m,y,name,giveplayer,days,reason);

            BanLog(string);

            PlayerBanned[playerid] = -1;

            SetTimerEx("ResetBan", 180000, 0, "d", playerid);

        }

        else

        {

            format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

            SendClientMessage(playerid, COLOR_GRAD1, string);

        }

      }

      else return SendClientMessage(playerid,COLOR_GRAD1,"You are not authorized to use that command");

      return true;

  }

[/pawn]

Sunt un retardat

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

"undefined symbol" = Simbol nedefinit.

"local variable "x" shadows a variable at a preceding level" = Variabila X este definita anterior.

"expected token: ";", but found "]"" = Trebuie sa fie ";" dar a gasit "]".

Rezolva-le ca nu este asa greu.

Link to comment
Share on other sites

"undefined symbol" = Simbol nedefinit.

"local variable "x" shadows a variable at a preceding level" = Variabila X este definita anterior.

"expected token: ";", but found "]"" = Trebuie sa fie ";" dar a gasit "]".

Rezolva-le ca nu este asa greu.

Am incercat si nmk.

Stiu ca nu este greu dar la erori nu prea ma pricep..

Sunt un retardat

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.