SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 09/01/2011, 11:19 PM   #1
[TDL]OGLoc
Big Clucker
 
Join Date: Dec 2009
Posts: 57
Reputation: 0
Default A Rare Error

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

Code:
warning 217: loose indentation
Why?
__________________


Server: Gangster Life City.
Forum: http://gangsterlife.foroactivo.com
Info: The life of ghetto citizens and Gangs. The Respect And the Fear is on the streetz.
Type Of Server: RPG Roleplay Gangster.
Name: [LSC]Sebas[IB].

ι∂ℓєωσσ∂ вαℓℓαѕ σя ℓιє
[TDL]OGLoc is offline  
Old 09/01/2011, 11:23 PM   #2
blackwave
Gangsta
 
Join Date: Oct 2010
Location: Fortaleza, Brazil
Posts: 967
Reputation: 7
Default Re: A Rare Error

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.
__________________






My youtube user: Click here
blackwave is offline  
Old 09/01/2011, 11:25 PM   #3
Souvlaki
Huge Clucker
 
Souvlaki's Avatar
 
Join Date: Jan 2010
Location: hacked
Posts: 414
Reputation: 1
Default Re: A Rare Error

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.
Souvlaki is offline  
Old 09/01/2011, 11:26 PM   #4
ToPhrESH
Gangsta
 
ToPhrESH's Avatar
 
Join Date: Jun 2010
Posts: 517
Reputation: 3
Default Re: A Rare Error

Some where you are missing an identation. Press tab to indent it to see if it fixes this.
ToPhrESH is offline  
Old 09/01/2011, 11:42 PM   #5
[TDL]OGLoc
Big Clucker
 
Join Date: Dec 2009
Posts: 57
Reputation: 0
Default Re: A Rare Error

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
__________________


Server: Gangster Life City.
Forum: http://gangsterlife.foroactivo.com
Info: The life of ghetto citizens and Gangs. The Respect And the Fear is on the streetz.
Type Of Server: RPG Roleplay Gangster.
Name: [LSC]Sebas[IB].

ι∂ℓєωσσ∂ вαℓℓαѕ σя ℓιє
[TDL]OGLoc is offline  
Old 09/01/2011, 11:53 PM   #6
Kyosaur
Gangsta
 
Kyosaur's Avatar
 
Join Date: Mar 2008
Location: USA - California
Posts: 973
Reputation: 349
Default Re: A Rare Error

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.
Kyosaur is offline  
Old 09/01/2011, 11:59 PM   #7
John_F
Huge Clucker
 
John_F's Avatar
 
Join Date: Jul 2010
Posts: 244
Reputation: 0
Default Re: A Rare Error

what he means is, strcmp is by far the worst option.
__________________

**New COD server!**
Hosted list!
64.120.47.67:7777
Forum: www.cod-dm.com

Need scripting support or a person to script for you? PM me.
John_F is offline  
Old 10/01/2011, 12:01 AM   #8
Krx17
Huge Clucker
 
Krx17's Avatar
 
Join Date: Jul 2010
Posts: 423
Reputation: 22
Default Re: A Rare Error

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.
Krx17 is offline  
Old 10/01/2011, 12:09 AM   #9
[TDL]OGLoc
Big Clucker
 
Join Date: Dec 2009
Posts: 57
Reputation: 0
Default Re: A Rare Error

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
__________________


Server: Gangster Life City.
Forum: http://gangsterlife.foroactivo.com
Info: The life of ghetto citizens and Gangs. The Respect And the Fear is on the streetz.
Type Of Server: RPG Roleplay Gangster.
Name: [LSC]Sebas[IB].

ι∂ℓєωσσ∂ вαℓℓαѕ σя ℓιє
[TDL]OGLoc is offline  
Old 10/01/2011, 12:13 AM   #10
John_F
Huge Clucker
 
John_F's Avatar
 
Join Date: Jul 2010
Posts: 244
Reputation: 0
Default Re: A Rare Error

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?
__________________

**New COD server!**
Hosted list!
64.120.47.67:7777
Forum: www.cod-dm.com

Need scripting support or a person to script for you? PM me.
John_F is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rare Exports: A Christmas Tale. SaW Everything and Nothing 2 10/12/2010 09:29 PM
[HELP] Rare Error justino Help Archive 5 30/11/2010 12:14 PM
Rare issue woot Server Support 4 26/02/2010 08:48 PM


All times are GMT. The time now is 12:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.