A Rare Error
#1

Code:
if(!strcmp(cmd, "/giverpp", true))
that think trowh this error:

Code:
warning 217: loose indentation
Why?
Reply
#2

Really have to do with that? nothing's wrong there. Also the code is correct, and should work. Post the line. Before and after one.
Reply
#3

Because strcmp is way too old to be used.

We need to see the whole structure of the command(i guess) to tell you, plus it's not an error but a warning.
Reply
#4

Some where you are missing an identation. Press tab to indent it to see if it fixes this.
Reply
#5

Code:
//============================================[ ROLEPLAY POINT] ====================================================
if(strcmp(cmd, "/giverpp", true) == 0)//mueve esto hacia adelante que quede al raz
    {//de este
        if(PlayerInfo[playerid][Level] >= 3)
        {
            new tmp[256], player1;//el 'tmp2' no hacia funcion y el 'tmp' no estaba definido
            tmp = strtok(cmdtext,idx);//aqui no tenia el ';'
            if(!strlen(tmp)) return SendClientMessage(playerid, yellow, "USAGE: /giverpp [playerid]");
            player1 = strval(tmp);
            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
            {
                CMDMessageToAdmins(playerid,"GIVERPP");
                SaveToFile("Rpp",string);
                PlayerInfo[player1][Rpp]++;
                format(string, sizeof(string), "You have given a Roleplay Point To \"%s\"", PlayerName2(player1));//aqui faltaba un ')'
                SendClientMessage(playerid,yellow,string);
                if(player1 != playerid)
                    {
                    format(string,sizeof(string),"Administrator \"%s\" has given you a Roleplay Point", PlayerName2(playerid));//aqui tambien un ')'
                    SendClientMessage(player1,yellow,string);
                    SendClientMessageToAll(yellow,"Administrator \"%s\" has given %s a Roleplay Point", PlayerName2(playerid), playerid);
					PlayerInfo[playerid][Rpp]++;
                    }
                } else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
            } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
        return 1;
    }
That is what i have
Reply
#6

Quote:
Originally Posted by Souvlaki
View Post
Because strcmp is way too old to be used.

We need to see the whole structure of the command(i guess) to tell you, plus it's not an error but a warning.
Strcmp is to old to be used!?! Hahahahahaha, not at all.



This warning is saying that something isnt indented correctly.

http://dracoblue.net/tidy/pawn/

This will re-indent your code, put the entire command inside and "convert" it.
Reply
#7

what he means is, strcmp is by far the worst option.
Reply
#8

No it's not. Where do people come up with these assumptions? Do you even know what strcmp stands for? String compare. If your comparing it to functions like sscanf, then you are an idiot. sscanf and strcmp serve two different purposes. strcmp will compare two strings to each other with or without case sensitivity and return whether they are the same or not. sscanf will compare a string with format codes and parse out values if the string matches the format codes.
Reply
#9

I can repair it but what about this one

Code:
new tmp[256], player1;
i get this warning

Code:
pwn(4454) : warning 219: local variable "tmp" shadows a variable at a preceding level
Reply
#10

Quote:
Originally Posted by Krx17
View Post
No it's not. Where do people come up with these assumptions? Do you even know what strcmp stands for? String compare. If your comparing it to functions like sscanf, then you are an idiot. sscanf and strcmp serve two different purposes. strcmp will compare two strings to each other with or without case sensitivity and return whether they are the same or not. sscanf will compare a string with format codes and parse out values if the string matches the format codes.
I never said to use sscanf in lieu of strcmp.
He's using it for commands, where strcmp is comparatively slow (compared to processors like zcmd and dcmd).
How about you read the thread before posting a useless reply?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)