CMD Warning and bug.
#1

I need some help with this, I will show the line which is warning.

Код:
CMD:removegarage(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337) return 0;
    for(new i=0; i < garageCount+1; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, gInfo[i][PosX], gInfo[i][PosY], gInfo[i][PosZ]))
            {
                        format(gInfo[i][Owner],24,"REMOVED");
                        gInfo[i][Owned] = -999;
                        gInfo[i][Price] = -999;
                        gInfo[i][Interior] = -999;
                        gInfo[i][UID] = -999;
                        gInfo[i][PosX] = -999;
                        gInfo[i][PosY] = -999;
                        gInfo[i][PosZ] = -999;
                        gInfo[i][Locked] = -999;
                        DestroyDynamic3DTextLabel(garageLabel[i]);
                        DestroyDynamicPickup(garagePickup[i]);
                        new path[128];
                        format(path,sizeof(path),"garages/%d.ini",i); //Format the path with the filenumber
                        dini_Remove(path);
                        SendClientMessage(playerid, COLOR_SUCCESS, "You have removed this garage.");
                        return 1;
                }
        }
>>>     SendClientMessage(playerid, COLOR_ERROR,"Error: You're not near any garage.");
        return 1;
}
Код:
CMD:enterg(playerid,params[])
{
        for(new i=0; i < garageCount+1; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, gInfo[i][PosX], gInfo[i][PosY], gInfo[i][PosZ]))
            {

                if(gInfo[i][Locked] == 1 && strcmp(GetPlayerNameEx(playerid),gInfo[i][Owner])) return SendClientMessage(playerid,COLOR_ERROR,"Error: You're not the owner of this garage. It's locked, you can't enter.");
                new gtype = gInfo[i][Interior];
                if(!IsPlayerInAnyVehicle(playerid))
                        {
                                SetPlayerVirtualWorld(playerid,gInfo[i][UID]);
                                SetPlayerInterior(playerid,floatround(GarageInteriors[gtype][4]));
                                SetPlayerPos(playerid,GarageInteriors[gtype][0],GarageInteriors[gtype][1],GarageInteriors[gtype][2]);
                                lastGarage[playerid] = i;
                        }
                        else
                        {
                                new vid = GetPlayerVehicleID(playerid);
                                LinkVehicleToInterior(vid,floatround(GarageInteriors[gtype][4]));
                                SetVehicleVirtualWorld(vid,gInfo[i][UID]);
                                SetPlayerVirtualWorld(playerid,gInfo[i][UID]);
                                SetPlayerInterior(playerid,floatround(GarageInteriors[gtype][4]));
                                SetVehiclePos(vid,GarageInteriors[gtype][0],GarageInteriors[gtype][1],GarageInteriors[gtype][2]);
                                lastGarage[playerid] = i;
                        }
 >>>>>>>                return 1;

                }
        }
        SendClientMessage(playerid,COLOR_ERROR,"Error: You're not near any garage. ");
        return 1;
}
Код:
CMD:buygarage(playerid, params[])
{
    for(new i=0; i < garageCount+1; i++)
        {
                if(IsPlayerInRangeOfPoint(playerid, 3.0, gInfo[i][PosX], gInfo[i][PosY], gInfo[i][PosZ]))
                {
                        if(gInfo[i][Owned] == 1) return SendClientMessage(playerid, COLOR_ERROR,"Error: This garage is already owned.");
                        if(GetPlayerMoney(playerid) < gInfo[i][Price]) return SendClientMessage(playerid,COLOR_ERROR,"Error: You don't have enough money to buy this garage.");
                        GivePlayerMoney(playerid,-gInfo[i][Price]);
                        gInfo[i][Price]-= random(5000); //Take some money off of the original price
                        format(gInfo[i][Owner],24,"%s",GetPlayerNameEx(playerid));
                        gInfo[i][Owned] = 1;
                        Save_Garage(i);
                        UpdateGarageInfo(i);
                        SendClientMessage(playerid,COLOR_SUCCESS,"You have successfully bought this garage.");
                        return 1;
                }
        }
>>>>>>  SendClientMessage(playerid,COLOR_ERROR,"Error: You're not near any garage.");
        return 1;
}
All of them have warning, and when i got in the server all them are bug even if it is warning on the code.
Reply
#2

show warnings
Reply
#3

show warning please!
Reply
#4

Код HTML:
H:\MAX RP v2.4\pawno\garage.pwn(257) : warning 217: loose indentation
H:\MAX RP v2.4\pawno\garage.pwn(287) : warning 217: loose indentation
H:\MAX RP v2.4\pawno\garage.pwn(339) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
this is the warning
Reply
#5

Код:
CMD:removegarage(playerid,params[])
{
        if(PlayerInfo[playerid][pAdmin] >= 1337) return 0;
        for(new i=0; i < garageCount+1; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, gInfo[i][PosX], gInfo[i][PosY], gInfo[i][PosZ]))
            {
                        format(gInfo[i][Owner],24,"REMOVED");
                        gInfo[i][Owned] = -999;
                        gInfo[i][Price] = -999;
                        gInfo[i][Interior] = -999;
                        gInfo[i][UID] = -999;
                        gInfo[i][PosX] = -999;
                        gInfo[i][PosY] = -999;
                        gInfo[i][PosZ] = -999;
                        gInfo[i][Locked] = -999;
                        DestroyDynamic3DTextLabel(garageLabel[i]);
                        DestroyDynamicPickup(garagePickup[i]);
                        new path[128];
                        format(path,sizeof(path),"garages/%d.ini",i); //Format the path with the filenumber
                        dini_Remove(path);
                        SendClientMessage(playerid, COLOR_SUCCESS, "You have removed this garage.");
                        return 1;
                }
        }
        SendClientMessage(playerid, COLOR_ERROR,"Error: You're not near any garage.");
        return 1;
}
Код:
CMD:enterg(playerid,params[])
{
        for(new i=0; i < garageCount+1; i++)
        {
               if(IsPlayerInRangeOfPoint(playerid, 3.0, gInfo[i][PosX], gInfo[i][PosY], gInfo[i][PosZ]))
              {

                        if(gInfo[i][Locked] == 1 && strcmp(GetPlayerNameEx(playerid),gInfo[i][Owner])) return               SendClientMessage(playerid,COLOR_ERROR,"Error: You're not the owner of this garage. It's locked, you can't enter.");
                        new gtype = gInfo[i][Interior];
                        if(!IsPlayerInAnyVehicle(playerid))
                        {
                                SetPlayerVirtualWorld(playerid,gInfo[i][UID]);
                                SetPlayerInterior(playerid,floatround(GarageInteriors[gtype][4]));
                                SetPlayerPos(playerid,GarageInteriors[gtype][0],GarageInteriors[gtype][1],GarageInteriors[gtype][2]);
                                lastGarage[playerid] = i;
                        }
                        else
                        {
                                new vid = GetPlayerVehicleID(playerid);
                                LinkVehicleToInterior(vid,floatround(GarageInteriors[gtype][4]));
                                SetVehicleVirtualWorld(vid,gInfo[i][UID]);
                                SetPlayerVirtualWorld(playerid,gInfo[i][UID]);
                                SetPlayerInterior(playerid,floatround(GarageInteriors[gtype][4]));
                                SetVehiclePos(vid,GarageInteriors[gtype][0],GarageInteriors[gtype][1],GarageInteriors[gtype][2]);
                                lastGarage[playerid] = i;
                        }
                }
        }
        SendClientMessage(playerid,COLOR_ERROR,"Error: You're not near any garage. ");
        return 1;
}
Код:
CMD:buygarage(playerid, params[])
{
        for(new i=0; i < garageCount+1; i++)
        {
                if(IsPlayerInRangeOfPoint(playerid, 3.0, gInfo[i][PosX], gInfo[i][PosY], gInfo[i][PosZ]))
                {
                        if(gInfo[i][Owned] == 1) return SendClientMessage(playerid, COLOR_ERROR,"Error: This garage is already owned.");
                        if(GetPlayerMoney(playerid) < gInfo[i][Price]) return SendClientMessage(playerid,COLOR_ERROR,"Error: You don't have enough money to buy this garage.");
                        GivePlayerMoney(playerid,-gInfo[i][Price]);
                        gInfo[i][Price]-= random(5000); //Take some money off of the original price
                        format(gInfo[i][Owner],24,"%s",GetPlayerNameEx(playerid));
                        gInfo[i][Owned] = 1;
                        Save_Garage(i);
                        UpdateGarageInfo(i);
                        SendClientMessage(playerid,COLOR_SUCCESS,"You have successfully bought this garage.");
                        return 1;
                }
        }
        SendClientMessage(playerid,COLOR_ERROR,"Error: You're not near any garage.");
        return 1;
}
Reply
#6

Shwazan, Here's a Tip:

Loose Indentation = Script Messy ( Doesnt bug your cmds or anything)

Want to stop Loose Indentations messages? use

<removed>

At top of script.
Reply
#7

Thanks for everything guys, rep+
Reply
#8

Shazwan, Use http://boylett.com/scripts/autoindent.php
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)