creating cmd error
#1

ok so i've got (from the original script) something like this

Код:
if(strcmp(cmd, "/factionlist", true) == 0) 

{
	if(IsPlayerConnected(playerid))

	{
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"*******************FACTIONS******************");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 1 | Faction Name: L.S.P.D |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 2 | Faction Name: F.B.I |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 3 | Faction Name: The Army |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 4 | Faction Name: L.S.M.D |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 5 | Faction Name: Los Sureсos |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 6 | Faction Name: La Famigla Sinatra|");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 7 | Faction Name: L.S Government |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 8 | Faction Name: Hitmen |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 9 | Faction Name: L.S News Channel |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 10 | Faction Name: L.S Taxi Cab Co. |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 11 | Faction Name: L.S Licensers |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 12 | Faction Name: L.S Fire Department |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 13 | Faction Name: Sons of Anarchy |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 14 | Faction Name: Inagawa |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 15 | Faction Name: Chornaya Bratva |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 16 | Faction Name: La Vice |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"*******************FACTIONS******************");
		new y, m, d;
		new h,mi,s;
		getdate(y,m,d);
		gettime(h,mi,s);
		format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s has Sent Chuck's Fact",d,m,y,h,mi,s,sendername);
		AdminLog(string);

	}
	return 1;

}
and i copied it and edited to get something like this


Код:
	if(strcmp(cmd, "/leaderlist", true) == 0) // By Dante

{
	if(IsPlayerConnected(playerid))

	{
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"**************FACTION Leaders*************"");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S.P.D |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: F.B.I |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: The Army |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S.M.D |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Los Sureсos |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: La Famigla Sinatra|");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Government |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Hitmen |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S News Channel |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Taxi Cab Co. |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Licensers |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Fire Department |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Sons of Anarchy |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Inagawa |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Chornaya Bratva |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: La Vice |");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"**************FACTION Leaders*************");
		new y, m, d;
		new h,mi,s;
		getdate(y,m,d);
		gettime(h,mi,s);
		format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s has Sent Chuck's Fact",d,m,y,h,mi,s,sendername);
		AdminLog(string);

	}
	return 1;

}
the problem is im getting "loose identation" error whenever i add the new command (leaderlist) or actually,any other new command



is there something i gotta edit to "increase" commands number ?


thx in advance
Reply
#2

And you would have gotten an error like this, "Unterminated String" something like that. The Reason *


This below is the fixed script.
pawn Код:
if(strcmp(cmd, "/leaderlist", true) == 0) // By Dante (This was far away from the left, Just compare mine and yours)
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"**************FACTION Leaders*************");//*This string is not terminated. Meaning you did not end it or kill it. To start you use " and for stop you use "  but you had "" for stop. You had 2 quotation marks for stop.
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S.P.D |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: F.B.I |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: The Army |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S.M.D |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Los Sureсos |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: La Famigla Sinatra|");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Government |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Hitmen |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S News Channel |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Taxi Cab Co. |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Licensers |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: L.S Fire Department |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Sons of Anarchy |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Inagawa |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: Chornaya Bratva |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction Leader: | Faction Name: La Vice |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"**************FACTION Leaders*************");
        new y, m, d;
        new h,mi,s;
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s has Sent Chuck's Fact",d,m,y,h,mi,s,sendername);
        AdminLog(string);
    }
    return 1;

}
This should work.

This one has the error in it so you can see where you went wrong.
pawn Код:
if(strcmp(cmd, "/leaderlist", true) == 0) // By Dante (This was far away from the left, Just compare mine and yours)
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"**************FACTION Leaders*************"");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S.P.D |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: F.B.I |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: The Army |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S.M.D |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: Los Sureсos |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: La Famigla Sinatra|");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S Government |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: Hitmen |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S News Channel |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S Taxi Cab Co. |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S Licensers |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: L.S Fire Department |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: Sons of Anarchy |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: Inagawa |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: Chornaya Bratva |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
| Faction Leader: | Faction Name: La Vice |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"
**************FACTION Leaders*************");
        new y, m, d;
        new h,mi,s;
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string,sizeof(string), "
(%d/%d/%d)[%d:%d:%d] %s has Sent Chuck's Fact",d,m,y,h,mi,s,sendername);
        AdminLog(string);
    }
    return 1;

}
NOTE: Next time use [ pawn ] [ /pawn ] and not [ code ] [ /code ]
Reply
#3

well thx for the reply but im still getting this


pawn Код:
E:\GTA SSan Andreas\SA-MP Beta Test Server\gamemodes\rp.pwn(59734) : warning 217: loose indentation
E:\GTA SSan Andreas\SA-MP Beta Test Server\gamemodes\rp.pwn(59767) : warning 217: loose indentation

the lines are

pawn Код:
if(strcmp(cmd, "/leaderlist", true) == 0) // By Dante )
and

pawn Код:
if(strcmp(cmd, "/resetspawn", true) == 0 || strcmp(cmd, "/spawnreset", true) == 0)
the start of another cmd (though if i delete the leaderlist it compiles without errors
Reply
#4

You can find that loose indentation easly
pawn Код:
E:\GTA SSan Andreas\SA-MP Beta Test Server\gamemodes\rp.pwn(59734) : warning 217: loose indentation
E:\GTA SSan Andreas\SA-MP Beta Test Server\gamemodes\rp.pwn(59767) : warning 217: loose indentation
when you compile you can see that like.Then press ctrl+g > type the like there > press ok
After that adjust the line by pressing "TAB" button.Thats all
Reply
#5

PHP код:
if(strcmp(cmd"/factionlist"true)  
{
    if(
IsPlayerConnected(playerid))
    {
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*******************FACTIONS******************");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 1 | Faction Name: L.S.P.D |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 2 | Faction Name: F.B.I |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 3 | Faction Name: The Army |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 4 | Faction Name: L.S.M.D |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 5 | Faction Name: Los Sureсos |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 6 | Faction Name: La Famigla Sinatra|");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 7 | Faction Name: L.S Government |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 8 | Faction Name: Hitmen |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 9 | Faction Name: L.S News Channel |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 10 | Faction Name: L.S Taxi Cab Co. |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 11 | Faction Name: L.S Licensers |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 12 | Faction Name: L.S Fire Department |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 13 | Faction Name: Sons of Anarchy |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 14 | Faction Name: Inagawa |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 15 | Faction Name: Chornaya Bratva |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 16 | Faction Name: La Vice |");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*******************FACTIONS******************");
        new 
ymd;
        new 
h,mi,s;
        
getdate(y,m,d);
        
gettime(h,mi,s);
        
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s has Sent Chuck's Fact",d,m,y,h,mi,s,sendername);
        
AdminLog(string);
    }
    return 
1;

Reply
#6

try this
pawn Код:
if(strcmp(cmd, "/factionlist", true)
{
        if(IsPlayerConnected(playerid))
        {
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"*******************FACTIONS******************");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 1 | Faction Name: L.S.P.D |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 2 | Faction Name: F.B.I |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 3 | Faction Name: The Army |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 4 | Faction Name: L.S.M.D |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 5 | Faction Name: Los Sureсos |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 6 | Faction Name: La Famigla Sinatra|");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 7 | Faction Name: L.S Government |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 8 | Faction Name: Hitmen |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 9 | Faction Name: L.S News Channel |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 10 | Faction Name: L.S Taxi Cab Co. |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 11 | Faction Name: L.S Licensers |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 12 | Faction Name: L.S Fire Department |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 13 | Faction Name: Sons of Anarchy |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 14 | Faction Name: Inagawa |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 15 | Faction Name: Chornaya Bratva |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"| Faction ID: 16 | Faction Name: La Vice |");
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"*******************FACTIONS******************");
        new y, m, d;
        new h,mi,s;
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s has Sent Chuck's Fact",d,m,y,h,mi,s,sendername);
        AdminLog(string);
        }
        return 1;

}
Reply
#7

i did like you said with tab and tried to allign them like the resetspawn (command below this one) and it worked


btw your last post is missing an ) from if(strcmp(cmd, "/factionlist", true)


thx for help guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)