SA-MP Forums Archive
/trunk won't close - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /trunk won't close (/showthread.php?tid=371860)



/trunk won't close - kbalor - 24.08.2012

I can use /trunk to open. But when I do /trunk again it won't close. It always show "Trunk Opened"


pawn Код:
CMD:trunks(playerid, params[])
{
        if(IsPlayerInAnyVehicle(playerid))
        {
                new vehicleid = GetPlayerVehicleID(playerid);
                new engine, lights, alarm, doors, bonnet, boot, objective;
                if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: You are not in the drivers seat");
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                if(boot == 1)
                {
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 0, objective);
                    GameTextForPlayer(playerid, "Trunk Closed", 200, 1);
                }
                else
                {
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
                    GameTextForPlayer(playerid, "Trunk Opened", 200, 1);
                }
        }
        else
        {
                SendClientMessage(playerid, 0xFFFFFFFF, "You must be in a vehicle to use this command!");
        }
        return 1;
}