Warning Help here
#1

Here warning i get


Код:
C:\Users\Robin\Desktop\New rp\gamemodes\RMRP.pwn(35564) : warning 217: loose indentation
C:\Users\Robin\Desktop\New rp\gamemodes\RMRP.pwn(35570) : warning 217: loose indentation
Код:
}
CMD:engine(playerid, params[])
{
    new
        giveplayerid,
        string[128],
        engine,
        lights,
        alarm,
        doors,
        bonnet,
        boot,
        objective,
        vehicleid = GetPlayerVehicleID(playerid);
					    
Line 35564                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
					if(IsASateCar(vehicleid)) return SendClientMessage(playerid,COLOR_RED,"You need to hotwire this car.");

					if(CanTurnEngine[playerid] == 9999)
					    return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");
					    
Line 35570	if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
	GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
    {
        SetVehicleEngine(vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
    {
        SetTimerEx("SetVehicleEngine", 3500, 0, "dd",  vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
Reply
#2

pawn Код:
//top of the script
#pragma tabsize 0
Reply
#3

pawn Код:
CMD:engine(playerid, params[])
{
    new
        giveplayerid,
        string[128],
        engine,
        lights,
        alarm,
        doors,
        bonnet,
        boot,
        objective,
        vehicleid = GetPlayerVehicleID(playerid);

    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
    if(IsASateCar(vehicleid)) return SendClientMessage(playerid,COLOR_RED,"You need to hotwire this car.");

    if(CanTurnEngine[playerid] == 9999)
        return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

    if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON) {
        SetVehicleEngine(vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)) {
        SetTimerEx("SetVehicleEngine", 3500, 0, "dd",  vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
}
Also, I don't recomment tabsize 0 because indentation is inportant in almost every computer language.
If you are using other languages too ,you will not be able to define it
Reply
#4

pawn Код:
CMD:engine(playerid, params[])
{
    new
        giveplayerid,
        string[128],
        engine,
        lights,
        alarm,
        doors,
        bonnet,
        boot,
        objective,
        vehicleid = GetPlayerVehicleID(playerid);

    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
    if(IsASateCar(vehicleid)) return SendClientMessage(playerid,COLOR_RED,"You need to hotwire this car.");
    if(CanTurnEngine[playerid] == 9999) return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");
    if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
    {
        SetVehicleEngine(vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
    {
        SetTimerEx("SetVehicleEngine", 3500, 0, "dd",  vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
}
Try this.
Reply
#5

Thank you both +rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)