24.08.2012, 19:02
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;
}