#1

Hey Guys!

I have a warning in my script:
Код:
(69) : warning 217: loose indentation
Here is the the function:
pawn Код:
case 17:
            {
                 new
                    vehiclemodel = random(212)+400,
                    Float:pPos[4],
                    vId;
                while(!IsValidVehicleID(vehiclemodel)) vehiclemodel = random(212)+400;//Line 69
                if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
                GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
                GetPlayerFacingAngle(playerid, pPos[3]);
                vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
                PutPlayerInVehicle(playerid, vId, 0);
            }
I cannot see the problem with it, no indentation loose, and when I make the line 69 to comment, the compiler still writes this warning..
Reply
#2

pawn Код:
case 17:
            {
                new
                vehiclemodel = random(212)+400,
                Float:pPos[4],
                vId;
                while(!IsValidVehicleID(vehiclemodel)) vehiclemodel = random(212)+400;//Line 69
                if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
                GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
                GetPlayerFacingAngle(playerid, pPos[3]);
                vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
                PutPlayerInVehicle(playerid, vId, 0);
            }
Try that

pawn Код:
case 17:
            {
                new vehiclemodel = random(212)+400, Float:pPos[4], vId;
                while(!IsValidVehicleID(vehiclemodel)) vehiclemodel = random(212)+400;//Line 69
                if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
                GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
                GetPlayerFacingAngle(playerid, pPos[3]);
                vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
                PutPlayerInVehicle(playerid, vId, 0);
            }
Or that
Reply
#3

Quote:
Originally Posted by Luis the Lobster
Посмотреть сообщение
pawn Код:
case 17:
            {
                new
                vehiclemodel = random(212)+400,
                Float:pPos[4],
                vId;
                while(!IsValidVehicleID(vehiclemodel)) vehiclemodel = random(212)+400;//Line 69
                if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
                GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
                GetPlayerFacingAngle(playerid, pPos[3]);
                vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
                PutPlayerInVehicle(playerid, vId, 0);
            }
Try that

pawn Код:
case 17:
            {
                new vehiclemodel = random(212)+400, Float:pPos[4], vId;
                while(!IsValidVehicleID(vehiclemodel)) vehiclemodel = random(212)+400;//Line 69
                if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
                GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
                GetPlayerFacingAngle(playerid, pPos[3]);
                vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
                PutPlayerInVehicle(playerid, vId, 0);
            }
Or that
Thanks, the problem was that there was a space before "new".
Reply
#4

pawn Код:
case 17:
{
    new vehiclemodel = random(212)+400;
    new Float:pPos[4];
    new vId;
    while(!IsValidVehicleID(vehiclemodel))
    {
        vehiclemodel = random(212)+400;
    }
    if(IsPlayerInAnyVehicle(playerid))
    {
        DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    GetPlayerFacingAngle(playerid, pPos[3]);
    vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
    PutPlayerInVehicle(playerid, vId, 0);
}
Why peoples like mess in their scripts, this one looks more clean
Reply
#5

Quote:
Originally Posted by ikey07
Посмотреть сообщение
pawn Код:
case 17:
{
    new vehiclemodel = random(212)+400;
    new Float:pPos[4];
    new vId;
    while(!IsValidVehicleID(vehiclemodel))
    {
        vehiclemodel = random(212)+400;
    }
    if(IsPlayerInAnyVehicle(playerid))
    {
        DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    GetPlayerFacingAngle(playerid, pPos[3]);
    vId = CreateVehicle(vehiclemodel, pPos[0], pPos[1], pPos[2], pPos[3], random(127), random(127), 60*1000);
    PutPlayerInVehicle(playerid, vId, 0);
}
Why peoples like mess in their scripts, this one looks more clean
Cuz it's shorter, and u just have to write "new" 1 time
Reply
#6

shorter and easly way to not understand in the end what you have writed.

all these Brecets {}{} is not made only to make script longer.

sry, off-topic
Reply
#7

Quote:
Originally Posted by ikey07
Посмотреть сообщение
shorter and easly way to not understand in the end what you have writed.

all these Brecets {}{} is not made only to make script longer.

sry, off-topic
Yea, ur right, I use brecets too, but for 2 or more lines
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
You should still indent, even if you don't use braces:



Anyway, unless your functions are badly named, that code won't work.
Why do You think that this won't work?
Reply
#9

Quote:
Originally Posted by Nonameman
Посмотреть сообщение
Why do You think that this won't work?
He's ******. Just listen to him. hes like.. epic
Reply
#10

WTH! i got a warning in my script! loosing identitation...
l0l is there an easier error/warning then this one?
i dont think so :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)