/trunk /hood
#1

EDIT:

How can i use this at the same time?

pawn Код:
CMD:hood(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(bonnet == 1)
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective);
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
    }
    return 1;
}

CMD:trunk(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(boot == 1)
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,0,objective);
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
    }
    return 1;
}
Reply
#2

You want a CMD that opens both the hood/trunk at the same time?
Reply
#3

Quote:
Originally Posted by Dawnz
Посмотреть сообщение
You want a CMD that opens both the hood/trunk at the same time?
No not that. I mean If I do /trunk and I use /hood. The trunk automatically close. Now If I do Hood the trunk close it can't be use both at the same time

I just want is I do /trunk it opens. I do /hood it opens too.
Reply
#4

You mean:
-If /trunk is used the boot will be closed.
-If /hood is used the bonnet will be closed. right?
pawn Код:
CMD:hood(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(bonnet == 1)
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,0,objective);
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,0,objective);
    }
    return 1;
}

CMD:trunk(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(boot == 1)
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,0,objective);
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,1,objective);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
You mean:
-If /trunk is used the boot will be closed.
-If /hood is used the bonnet will be closed. right?
pawn Код:
CMD:hood(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(bonnet == 1)
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,0,objective);
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,0,objective);
    }
    return 1;
}

CMD:trunk(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(boot == 1)
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,0,objective);
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,1,objective);
    }
    return 1;
}
Thanks for the reply but I need the opposite

If /trunk is used. And I do /hood, the hood will open and the trunk must still be opened too (coz when I do /hood and try to use /trunk the hood automatically close)
Reply
#6

Aaaa... OK. Now I understand.
pawn Код:
CMD:hood(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(bonnet == 1)
    {
        if(boot == VEHICLE_PARAMS_ON)
        {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,VEHICLE_PARAMS_ON,objective);
        } else {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,objective);
        }
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
    }
    return 1;
}

CMD:trunk(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(boot == VEHICLE_PARAMS_ON)
    {
        if(bonnet == 1)
        {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,0,objective);
        } else {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,objective);
        }
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
    }
    return 1;
}
Actually, it's strange your problem because if you do that (let's suppose that hood is open and trunk closed):
pawn Код:
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
//Return:          vehicleid,  0,      0,      0,     0,    1,  0,       0
//And we set them again with same values just changing trunk to true.
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_on,objective);
//Everything else should be the same, except the trunk.
Reply
#7

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
Aaaa... OK. Now I understand.
pawn Код:
CMD:hood(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(bonnet == 1)
    {
        if(boot == VEHICLE_PARAMS_ON)
        {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,VEHICLE_PARAMS_ON,objective);
        } else {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,objective);
        }
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
    }
    return 1;
}

CMD:trunk(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(boot == VEHICLE_PARAMS_ON)
    {
        if(bonnet == 1)
        {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,0,objective);
        } else {
            SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,objective);
        }
    }
    else
    {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
    }
    return 1;
}
Actually, it's strange your problem because if you do that (let's suppose that hood is open and trunk closed):
pawn Код:
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
//Return:          vehicleid,  0,      0,      0,     0,    1,  0,       0
//And we set them again with same values just changing trunk to true.
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_on,objective);
//Everything else should be the same, except the trunk.
OMG! It still automatically close Anyway thanks for trying..

Hope there's a solution for this

I just want that I can use trunk and hood opened at the same time.
Reply
#8

We can't leave that unfixed. I don't see any error there. So..
If you have Team Viewer PM me with ID and pass.
Also, try again with:
pawn Код:
CMD:hood(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(bonnet == VEHICLE_PARAMS_ON) {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    }
    else {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
    }
    return 1;
}

CMD:trunk(playerid, params[])
{
    new vehicleid,engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in a vehicle.");
    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not in the drivers seat.");
    if(boot == VEHICLE_PARAMS_ON) {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    }
    else {
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
    }
    return 1;
}
Reply
#9

thx br0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)