pawn Код:
if(strcmp(cmd, "/trunk", true) == 0)
{
if(gPlayerHasCar[playerid] == 0) return SendClientMessage(playerid, -1, ""#COL_RED"[error]: "#COL_WHITE"u dont have vehicle keys");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1, ""#COL_GREY"[usage]: "#COL_WHITE"/trunk open / close / store / take");
return 1;
}
if(strcmp(tmp, "open", true) == 0)
{
if(TrunkOpen[Vehicle[playerid]] == 1) return SendClientMessage(playerid, -1, ""#COL_RED"[error]: "#COL_WHITE"trunk is already opened");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
TrunkOpen[Vehicle[playerid]] = 1;
return 1;
}
else if(strcmp(tmp, "store", true) == 0)
{
if(TrunkOpen[Vehicle[playerid]] == 0) { SendClientMessage(playerid, -1, ""#COL_RED"[error]: "#COL_WHITE"open trunk first"); return 1; };
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, -1, ""#COL_GREY"[usage]: "#COL_WHITE"/trunk store armour amount of armour / weapon ... .. . .. . ."); return 1; }
if(strcmp(tmp, "armour", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1, ""#COL_GREY"[usage]: "#COL_WHITE"/trunk open / close / store / take");
return 1;
}
new amount = strval(tmp);
// continue here
}
}
return 1;
}