/trunk command help
#1

So I have a /trunk command but it only opens/close the trunk... But I want it so It would be /trunk open/close

code as of now...
Код:
CMD:trunk(playerid, params[])
{
    new string[128], done, idx;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pVeh] || PlayerInfo[playerid][pVVeh])
    {
        new Float:vx, Float:vy, Float:vz;
        GetVehiclePos(PlayerInfo[playerid][pVeh], vx, vy, vz);
        if(IsPlayerInRangeOfPoint(playerid, 4, vx, vy, vz))
        {
            idx = PlayerInfo[playerid][pVeh];
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
            if(!boot)
            {

                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 1, objective);
                format(string, sizeof(string), "* %s opens their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Trunk Opened", 3500, 3);
                topened[playerid] = 1;
            }
            else
            {
                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 0, objective);
                format(string, sizeof(string), "* %s closes their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Trunk Closed", 3500, 3);
                topened[playerid] = 0;
            }
            done = 1;
            return 1;
        }
        GetVehiclePos(PlayerInfo[playerid][pVVeh], vx, vy, vz);
        if(IsPlayerInRangeOfPoint(playerid, 4, vx, vy, vz))
        {
            idx = PlayerInfo[playerid][pVVeh];
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
            if(!boot)
            {

                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 1, objective);
                format(string, sizeof(string), "* %s opens their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Trunk Opened", 3500, 3);
                topened[playerid] = 1;
            }
            else
            {
                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 0, objective);
                format(string, sizeof(string), "* %s closes their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Trunk Closed", 3500, 3);
                topened[playerid] = 0;
            }
            done = 1;
        }
        if(!done) SendClientMessage(playerid, COLOR_GREY, "You are not near a vehicle you own.");
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "You don't own any vehicle.");
        return 1;
    }
    return 1;
}
how i want it...
Код:
CMD:trunk(playerid, params[])
{
    new string[128], done, idx;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pVeh] || PlayerInfo[playerid][pVVeh])
    {
        SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /trunk [open/close]");
        SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /trunk [balance/upgrade]");
        SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /trunk [deposit/withdraw] [type] [amount]");
        SendClientMessage(playerid, COLOR_GREY, "** Upgrading a trunk costs $25,000 each new level.");
        return 1;
    }
    if(!strcmp(params, "open", true))
    {

    }
    else if(!strcmp(params, "close", true))
    {

    }
    return 1;
}
Reply


Messages In This Thread
/trunk command help - by MichaelWharton101 - 05.05.2013, 01:13
Re: /trunk command help - by MichaelWharton101 - 05.05.2013, 02:41
Re: /trunk command help - by DobbysGamertag - 05.05.2013, 02:50
Re: /trunk command help - by MichaelWharton101 - 05.05.2013, 02:58
Re: /trunk command help - by SimpalK - 05.05.2013, 05:18
Re: /trunk command help - by RaminTurbo - 03.05.2018, 21:00
Re: /trunk command help - by kovac - 03.05.2018, 22:25
Re: /trunk command help - by CrystalGamer - 04.05.2018, 10:57

Forum Jump:


Users browsing this thread: 3 Guest(s)