Warning loose indentation // NEED RETURN TOO
#1

How to fix that?



BTW, I am newbie. I suck a little bit on scripting;p
Reply
#2

You need to indent your code properly.. This is a pretty good topic on the matter.
Reply
#3

Well I am kinda confused..;/
Could you do that for me?
Reply
#4

Post the code here, or at http://www.pastebin.com
Reply
#5

Here:

http://pastebin.com/59C3EKw7
Reply
#6

pawn Код:
CMD:supmobil(playerid, params[])
{
if(HasSupmobil[playerid] == 1)
{
for(new v=0; v<MAX_VEHICLES; v++)
{
if(v == SupMobil[playerid])
{
SupMobilLocked[v] = 0;
}
DestroyVehicle(SupMobil[playerid]);
HasSupmobil[playerid] = 0;
DestroyDynamic3DTextLabel(Text3D:SupMobilText[playerid]);
DestroyObject(SupMobilLicht[playerid]);
DestroyObject(SupMobilLicht2[playerid]);
SendClientMessage(playerid,COLOR_RED,"Supmobil destroyed!");
return 1;
}
if(pInfo[playerid][Adminlevel] >= 1)
{
ShowPlayerDialog(playerid, DIALOG_SUPMOBIL, DIALOG_STYLE_LIST, "Supmobil","Classic Supmobil\nComet Mobil\nQuad Mobil", "Spawnen", "Abbruch");
}
else
{
SendClientMessage(playerid,0xFF0000FF,"{FF0000}[SERVER]{BABABA}You're not authorized to use that command.");
return 1;
}
}
}
return 1;
}
}
Reply
#7

Still nothing..
Reply
#8

pawn Код:
CMD:supmobil(playerid, params[])
{
    if(!pInfo[playerid][Adminlevel]) return SendClientMessage(playerid, 0xFF0000FF, "[SERVER] {BABABA}You're not authorized to use that command.");
    if(HasSupmobil[playerid] == 1)
    {
        for(new v = 0; v < MAX_VEHICLES; v++)
        {
            if(v == SupMobil[playerid]) SupMobilLocked[v] = 0;
        }
        DestroyVehicle(SupMobil[playerid]);
        HasSupmobil[playerid] = 0;
        DestroyDynamic3DTextLabel(Text3D:SupMobilText[playerid]);
        DestroyObject(SupMobilLicht[playerid]);
        DestroyObject(SupMobilLicht2[playerid]);
        SendClientMessage(playerid, COLOR_RED, "Supmobil destroyed!");
        return 1;
    }
    ShowPlayerDialog(playerid, DIALOG_SUPMOBIL, DIALOG_STYLE_LIST, "Supmobil", "Classic Supmobil\nComet Mobil\nQuad Mobil", "Spawnen", "Abbruch");
    return 1;
}
Assumptions were made.
Reply
#9

Quote:
Originally Posted by LivingLikeYouDo
Посмотреть сообщение
[code that has fucked up indentation even more than the main one]
What's this lol...

You had like 3 extra curly brackets and return 0 instead of 1.
pawn Код:
CMD:supmobil(playerid, params[])
{
    if(HasSupmobil[playerid] == 1)
    {
        for(new v=0; v<MAX_VEHICLES; v++)
        {
            if(v == SupMobil[playerid])
            {
                SupMobilLocked[v] = 0;
            }
            DestroyVehicle(SupMobil[playerid]);
            HasSupmobil[playerid] = 0;
            DestroyDynamic3DTextLabel(Text3D:SupMobilText[playerid]);
            DestroyObject(SupMobilLicht[playerid]);
            DestroyObject(SupMobilLicht2[playerid]);
            SendClientMessage(playerid,COLOR_RED,"Supmobil destroyed!");
            break; // You had return 1 here
        }
        if(pInfo[playerid][Adminlevel] >= 1)
        {
            ShowPlayerDialog(playerid, DIALOG_SUPMOBIL, DIALOG_STYLE_LIST, "Supmobil","Classic Supmobil\nComet Mobil\nQuad Mobil", "Spawnen", "Abbruch");
        }
        else
        {
            SendClientMessage(playerid,0xFF0000FF,"{FF0000}[SERVER]{BABABA}You're not authorized to use that command.");
            return 1;
        }
    }      
    return 1;
}
Reply
#10

Ahh! Thanks guys
#FIXED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)